Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMIDT-468 Add timing collection and reporting to parodus2ccsp #31

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_ANSC_LINUX ")
set(SOURCES broadband/ssp_messagebus_interface.c broadband/ssp_main.c broadband/ssp_action.c broadband/cosa_webpa_dml.c broadband/cosa_webpa_internal.c broadband/cosa_webpa_apis.c broadband/plugin_main.c broadband/webpa_adapter.c broadband/webpa_internal.c broadband/webpa_table.c broadband/webpa_parameter.c broadband/webpa_attribute.c broadband/webpa_notification.c app/main.c app/libpd.c)
set(SOURCES broadband/ssp_messagebus_interface.c broadband/ssp_main.c broadband/ssp_action.c broadband/cosa_webpa_dml.c broadband/cosa_webpa_internal.c broadband/cosa_webpa_apis.c broadband/plugin_main.c broadband/webpa_adapter.c broadband/webpa_internal.c broadband/webpa_table.c broadband/webpa_replace.c broadband/webpa_parameter.c broadband/webpa_attribute.c broadband/webpa_notification.c app/main.c app/libpd.c)
set(HEADERS app/libpd.h)
add_executable(webpa ${SOURCES} ${HEADERS})
set(COMMON_LIBS -ldbus-1 -lccsp_common -lwrp-c -lpthread -lwdmp-c -lmsgpackc -ltrower-base64 -lm -lnanomsg -lcjson -lrt -llibparodus -lcimplog)
Expand Down
14 changes: 11 additions & 3 deletions source/app/libpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ static void connect_parodus()

static void parodus_receive()
{
int rtn;
int rtn, i;
wrp_msg_t *wrp_msg;
wrp_msg_t *res_wrp_msg ;

Expand Down Expand Up @@ -133,9 +133,8 @@ static void parodus_receive()
{
memset(res_wrp_msg, 0, sizeof(wrp_msg_t));
getCurrentTime(startPtr);
processRequest((char *)wrp_msg->u.req.payload, wrp_msg->u.req.transaction_uuid, ((char **)(&(res_wrp_msg->u.req.payload))));
processRequest((char *)wrp_msg->u.req.payload, wrp_msg->u.req.transaction_uuid, wrp_msg->u.req.include_spans, ((char **)(&(res_wrp_msg->u.req.payload))), &res_wrp_msg->u.req.spans);


if(res_wrp_msg->u.req.payload !=NULL)
{
WalPrint("Response payload is %s\n",(char *)(res_wrp_msg->u.req.payload));
Expand All @@ -151,6 +150,15 @@ static void parodus_receive()
if(wrp_msg->u.req.transaction_uuid != NULL){
res_wrp_msg->u.req.transaction_uuid = wrp_msg->u.req.transaction_uuid;
}
res_wrp_msg->u.req.include_spans = wrp_msg->u.req.include_spans;
if(res_wrp_msg->u.req.include_spans)
{
WalPrint("res_wrp_msg->u.req.spans.count = %d\n",res_wrp_msg->u.req.spans.count);
for(i=0; i<res_wrp_msg->u.req.spans.count; i++)
{
WalPrint("res_wrp_msg->u.req.spans.spans[i].name = %s res_wrp_msg->u.req.spans.spans[i].start = %llu res_wrp_msg->u.req.spans.spans[i].duration = %lu\n",res_wrp_msg->u.req.spans.spans[i].name, res_wrp_msg->u.req.spans.spans[i].start, res_wrp_msg->u.req.spans.spans[i].duration);
}
}
contentType = strdup(CONTENT_TYPE_JSON);
if(contentType != NULL)
{
Expand Down
51 changes: 51 additions & 0 deletions source/broadband/include/webpa_table.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* @file webpa_internal.h
*
* @description This file describes the Webpa Abstraction Layer
*
* Copyright (c) 2015 Comcast
*/
#include "ssp_global.h"
#include <stdio.h>
#include "ccsp_dm_api.h"
#include <sys/time.h>
#include "webpa_adapter.h"
#include "webpa_internal.h"

/*----------------------------------------------------------------------------*/
/* Macros */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Data Structures */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* Function Prototypes */
/*----------------------------------------------------------------------------*/

/**
* @brief addRow adds new row to the table
*
* param[in] object table name
* @param[in] CompName Component Name of parameters
* @param[in] dbusPath dbus path of parameters
* param[out] retIndex return new row added
*/
int addRow(char *object,char *compName,char *dbusPath, money_trace_spans *timeSpan,int *retIndex);

/**
* @brief updateRow updates row data
*
* param[in] objectName table name
* param[in] list Parameter name/value pairs
* param[out] retObject return new row added
* param[out] retStatus Returns status
*/
int updateRow(char *objectName,TableData *list,char *compName,char *dbusPath, uint32_t *duration);

/**
* @brief deleteRow deletes table row
*
* param[in] object table name to delete
*/
int deleteRow(char *object, money_trace_spans *timeSpan);
Loading