|
|
@ -3313,6 +3313,11 @@ flail: |
|
|
|
return ok; |
|
|
|
return ok; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Keep some simple stats on how often shares are out of order
|
|
|
|
|
|
|
|
* and how often they produce a WARNING due to OOOLIMIT */ |
|
|
|
|
|
|
|
static int64_t ooof0, ooof, oool0, oool; |
|
|
|
|
|
|
|
#define OOOLIMIT -2.0 |
|
|
|
|
|
|
|
|
|
|
|
bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row, K_ITEM *ss_item, |
|
|
|
bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row, K_ITEM *ss_item, |
|
|
|
char *by, char *code, char *inet, tv_t *cd, WHERE_FFL_ARGS) |
|
|
|
char *by, char *code, char *inet, tv_t *cd, WHERE_FFL_ARGS) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -3442,15 +3447,21 @@ bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row, K_ITE |
|
|
|
if (td < 0.0) { |
|
|
|
if (td < 0.0) { |
|
|
|
char *tmp1, *tmp2; |
|
|
|
char *tmp1, *tmp2; |
|
|
|
int level; |
|
|
|
int level; |
|
|
|
// DEBUG only for shares out of order up to 1 second
|
|
|
|
// DEBUG only for shares out of order up to OOOLIMIT seconds
|
|
|
|
if (td < -1.0) |
|
|
|
if (td < OOOLIMIT) { |
|
|
|
level = LOG_WARNING; |
|
|
|
level = LOG_WARNING; |
|
|
|
else |
|
|
|
ooof++; |
|
|
|
|
|
|
|
} else { |
|
|
|
level = LOG_DEBUG; |
|
|
|
level = LOG_DEBUG; |
|
|
|
LOGMSG(level, "%s(): OoO %s createdate (%s) is < summary firstshare (%s)", |
|
|
|
ooof0++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
LOGMSG(level, "%s(): OoO %s createdate (%s) is < summary" |
|
|
|
|
|
|
|
" firstshare (%s) (F%"PRId64":%"PRId64 |
|
|
|
|
|
|
|
"/L%"PRId64":%"PRId64"/%.1f)", |
|
|
|
__func__, s_row ? "shares" : "shareerrors", |
|
|
|
__func__, s_row ? "shares" : "shareerrors", |
|
|
|
(tmp1 = ctv_to_buf(sharecreatedate, NULL, 0)), |
|
|
|
(tmp1 = ctv_to_buf(sharecreatedate, NULL, 0)), |
|
|
|
(tmp2 = ctv_to_buf(&(row->firstshare), NULL, 0))); |
|
|
|
(tmp2 = ctv_to_buf(&(row->firstshare), NULL, 0)), |
|
|
|
|
|
|
|
ooof, ooof0, oool, oool0, OOOLIMIT); |
|
|
|
free(tmp2); |
|
|
|
free(tmp2); |
|
|
|
free(tmp1); |
|
|
|
free(tmp1); |
|
|
|
row->firstshare.tv_sec = sharecreatedate->tv_sec; |
|
|
|
row->firstshare.tv_sec = sharecreatedate->tv_sec; |
|
|
@ -3466,15 +3477,21 @@ bool _sharesummary_update(PGconn *conn, SHARES *s_row, SHAREERRORS *e_row, K_ITE |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
char *tmp1, *tmp2; |
|
|
|
char *tmp1, *tmp2; |
|
|
|
int level; |
|
|
|
int level; |
|
|
|
// DEBUG only for shares out of order up to 1 second
|
|
|
|
// DEBUG only for shares out of order up to OOOLIMIT seconds
|
|
|
|
if (td < -1.0) |
|
|
|
if (td < OOOLIMIT) { |
|
|
|
level = LOG_WARNING; |
|
|
|
level = LOG_WARNING; |
|
|
|
else |
|
|
|
oool++; |
|
|
|
|
|
|
|
} else { |
|
|
|
level = LOG_DEBUG; |
|
|
|
level = LOG_DEBUG; |
|
|
|
LOGMSG(level, "%s(): OoO %s createdate (%s) is < summary lastshare (%s)", |
|
|
|
oool0++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
LOGMSG(level, "%s(): OoO %s createdate (%s) is < summary" |
|
|
|
|
|
|
|
" lastshare (%s) (F%"PRId64":%"PRId64 |
|
|
|
|
|
|
|
"/L%"PRId64":%"PRId64"/%.1f)", |
|
|
|
__func__, s_row ? "shares" : "shareerrors", |
|
|
|
__func__, s_row ? "shares" : "shareerrors", |
|
|
|
(tmp1 = ctv_to_buf(sharecreatedate, NULL, 0)), |
|
|
|
(tmp1 = ctv_to_buf(sharecreatedate, NULL, 0)), |
|
|
|
(tmp2 = ctv_to_buf(&(row->lastshare), NULL, 0))); |
|
|
|
(tmp2 = ctv_to_buf(&(row->lastshare), NULL, 0)), |
|
|
|
|
|
|
|
ooof, ooof0, oool, oool0, OOOLIMIT); |
|
|
|
free(tmp2); |
|
|
|
free(tmp2); |
|
|
|
free(tmp1); |
|
|
|
free(tmp1); |
|
|
|
} |
|
|
|
} |
|
|
|