summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
e981e86)
Signed-off-by: vlad shkapenyuk <vshkap@research.att.com>
Change-Id: I2b266eba37bbe1a8bd2ea420c7b270211be64ce4
///////////////////////////////////////////////////////////
uint FUN [LFTA_LEGAL, COST FREE] EQ (uint, uint);
///////////////////////////////////////////////////////////
uint FUN [LFTA_LEGAL, COST FREE] EQ (uint, uint);
+ uint FUN [LFTA_LEGAL, COST FREE] EQ (ullong, ullong);
uint FUN [LFTA_LEGAL, COST FREE] GEQ (uint, uint);
uint FUN [LFTA_LEGAL, COST FREE] GEQ (uint, uint);
+ uint FUN [LFTA_LEGAL, COST FREE] GEQ (ullong, ullong);
uint FUN [LFTA_LEGAL, COST FREE] LEQ (uint, uint);
uint FUN [LFTA_LEGAL, COST FREE] LEQ (uint, uint);
+ uint FUN [LFTA_LEGAL, COST FREE] LEQ (ullong, ullong);
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
void FIRST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
void FIRST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
void FIRST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
void FIRST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
+void FIRST_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
+void FIRST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
+void FIRST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
+void FIRST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch);
+void FIRST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch);
+
+
void FIRST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
void FIRST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
void FIRST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
void FIRST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
void FIRST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
void FIRST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch);
void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch);
+void LAST_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
+void LAST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
+void LAST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
+void LAST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch);
+void LAST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch);
+
void LAST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
void LAST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
void LAST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch);
void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch);
void LAST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val);
void FIRST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) {
*scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX
}
void FIRST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) {
*scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX
}
void FIRST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }
void FIRST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }
void FIRST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) {
if (*scratch == UINT_MAX)
*scratch = val;
}
void FIRST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) {
if (*scratch == UINT_MAX)
*scratch = val;
}
void FIRST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) {
*res = *scratch;
}
void FIRST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) {
*res = *scratch;
}
void FIRST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { }
void FIRST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { }
+void FIRST_HFTA_AGGR_INIT_(gs_uint64_t* scratch) {
+ *scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX
+}
+void FIRST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { }
+void FIRST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) {
+ if (*scratch == UINT_MAX)
+ *scratch = val;
+}
+void FIRST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) {
+ *res = *scratch;
+}
+void FIRST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { }
+
+
+
void FIRST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch) {
*scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX
}
void FIRST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch) {
*scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX
}
// hfta only
void LAST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { }
// hfta only
void LAST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { }
void LAST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }
void LAST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }
void LAST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) {
*scratch = val;
}
void LAST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) {
*scratch = val;
}
void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) {
*res = *scratch;
}
void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) {
*res = *scratch;
}
void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { }
void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { }
+
+void LAST_HFTA_AGGR_INIT_(gs_uint64_t* scratch) { }
+void LAST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { }
+void LAST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) {
+ *scratch = val;
+}
+void LAST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) {
+ *res = *scratch;
+}
+void LAST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { }
+
+
+
void LAST_ULLHFTA_AGGR_INIT_(gs_uint64_t* scratch) { }
void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { }
void LAST_ULLHFTA_AGGR_INIT_(gs_uint64_t* scratch) { }
void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { }
int listensockfd=0;
int fd=0;
int listensockfd=0;
int fd=0;
+// how frequently we will log stats (expressed in tuples posted)
+#define STAT_FREQUENCY 30
+
// Not all systems have timersub defined so make sure its ther
#ifndef timersub
// Not all systems have timersub defined so make sure its ther
#ifndef timersub
gs_uint32_t tlimit = 0; // time limit in seconds
time_t start_time, curr_time;
gs_uint32_t tlimit = 0; // time limit in seconds
time_t start_time, curr_time;
+
+ gs_uint64_t post_success_cnt = 0ULL;
+ gs_uint64_t post_failure_cnt = 0ULL;
long unsigned int lineno=0;
long unsigned int seqno=0;
long unsigned int lineno=0;
long unsigned int seqno=0;
- unsigned int measurement_interval;
+ double measurement_interval;
while((code=ftaapp_get_tuple(&rfta_id,&rsize,rbuf,2*MAXTUPLESZ,0))>=0) {
lineno++;
if (dump) // -D in command line
while((code=ftaapp_get_tuple(&rfta_id,&rsize,rbuf,2*MAXTUPLESZ,0))>=0) {
lineno++;
if (dump) // -D in command line
else
pos += snprintf(linebuf+pos,MAXLINE-pos," \"%s\": \"%d\"",field_names[y], ar.r.i);
if(y==measurement_interval_pos)
else
pos += snprintf(linebuf+pos,MAXLINE-pos," \"%s\": \"%d\"",field_names[y], ar.r.i);
if(y==measurement_interval_pos)
- measurement_interval = (unsigned int)ar.r.i;
+ measurement_interval = (double)ar.r.i;
break;
case UINT_TYPE:
if(ves_version < 7)
break;
case UINT_TYPE:
if(ves_version < 7)
else
pos += snprintf(linebuf+pos,MAXLINE-pos," \"%s\": \"%u\"",field_names[y], ar.r.ui);
if(y==measurement_interval_pos)
else
pos += snprintf(linebuf+pos,MAXLINE-pos," \"%s\": \"%u\"",field_names[y], ar.r.ui);
if(y==measurement_interval_pos)
- measurement_interval = (unsigned int)ar.r.ui;
+ measurement_interval = (double)ar.r.ui;
break;
case IP_TYPE:
if(ves_version < 7)
break;
case IP_TYPE:
if(ves_version < 7)
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%u\"}",field_names[y], ar.r.ui);
if(y==measurement_interval_pos)
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%u\"}",field_names[y], ar.r.ui);
if(y==measurement_interval_pos)
- measurement_interval = (unsigned int)ar.r.ui;
+ measurement_interval = (double)ar.r.ui;
break;
case BOOL_TYPE:
if(ves_version < 7){
break;
case BOOL_TYPE:
if(ves_version < 7){
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%llu\"",field_names[y], ar.r.ul);
if(y==measurement_interval_pos)
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%llu\"",field_names[y], ar.r.ul);
if(y==measurement_interval_pos)
- measurement_interval = (unsigned int)ar.r.ul;
+ measurement_interval = (double)ar.r.ul;
break;
case LLONG_TYPE:
if(ves_version < 7)
break;
case LLONG_TYPE:
if(ves_version < 7)
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%lld\"",field_names[y], ar.r.l);
if(y==measurement_interval_pos)
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%lld\"",field_names[y], ar.r.l);
if(y==measurement_interval_pos)
- measurement_interval = (unsigned int)ar.r.l;
+ measurement_interval = (double)ar.r.l;
break;
case FLOAT_TYPE:
if(ves_version < 7)
pos += snprintf(linebuf+pos,MAXLINE-pos,"{\"name\": \"%s\", \"value\": \"%f\"}",field_names[y], ar.r.f);
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%f\"",field_names[y], ar.r.f);
break;
case FLOAT_TYPE:
if(ves_version < 7)
pos += snprintf(linebuf+pos,MAXLINE-pos,"{\"name\": \"%s\", \"value\": \"%f\"}",field_names[y], ar.r.f);
else
pos += snprintf(linebuf+pos,MAXLINE-pos,"\"%s\": \"%f\"",field_names[y], ar.r.f);
+ if(y==measurement_interval_pos)
+ measurement_interval = (double)ar.r.f;
break;
case TIMEVAL_TYPE:
{
break;
case TIMEVAL_TYPE:
{
}
if(ves_version < 7){
snprintf(linebuf+pos, MAXLINE-pos,
}
if(ves_version < 7){
snprintf(linebuf+pos, MAXLINE-pos,
- "], \"measurementInterval\": %u, \"measurementsForVfScalingVersion\": 1"
+ "], \"measurementInterval\": %f, \"measurementsForVfScalingVersion\": 1"
"}}}\n", measurement_interval
);
}else{
snprintf(linebuf+pos, MAXLINE-pos,
"}}}\n", measurement_interval
);
}else{
snprintf(linebuf+pos, MAXLINE-pos,
- "}, \"measurementInterval\": %u, \"measurementFieldsVersion\": \"4.0\""
+ "}, \"measurementInterval\": %f, \"measurementFieldsVersion\": \"4.0\""
"}}}\n", measurement_interval
);
}
"}}}\n", measurement_interval
);
}
}else{
http_post_request_hdr(curl_endpoint, curl_url, linebuf, &http_code, curl_auth);
if(http_code != 200 && http_code != 202){
}else{
http_post_request_hdr(curl_endpoint, curl_url, linebuf, &http_code, curl_auth);
if(http_code != 200 && http_code != 202){
gslog(LOG_WARNING, "http return code is %d\n",http_code);
gslog(LOG_WARNING, "http return code is %d\n",http_code);
+ } else {
+ post_success_cnt++;
+ }
+ if (((post_success_cnt+post_failure_cnt) % STAT_FREQUENCY) == 0)
+ gslog(LOG_WARNING, "%s: successful ves posts - %llu, failed ves posts - %llu\n", argv[0], post_success_cnt, post_failure_cnt);
}
if (verbose!=0) fflush(stdout);
} else {
if (rfta_id.streamid != fta_id.streamid)
}
if (verbose!=0) fflush(stdout);
} else {
if (rfta_id.streamid != fta_id.streamid)
- fprintf(stderr,"Got unkown streamid %llu \n",rfta_id.streamid);
+ fprintf(stderr,"Got unknown streamid %llu \n",rfta_id.streamid);
}
// whenever we receive a temp tuple check if we reached time limit
}
// whenever we receive a temp tuple check if we reached time limit