diff options
| author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-06-01 18:47:44 +0200 |
|---|---|---|
| committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-06-01 18:47:44 +0200 |
| commit | 85c13205190b29e2c188ed613d61730030cca9db (patch) | |
| tree | 195d2bf6c1d22841527b42f3da56d23f27b9c0e5 /runtime | |
| parent | 1498c2701301fadc6f902208068fc959c8673322 (diff) | |
| parent | d886dd979ebc94b45eb31255a24d49316dfcf6d0 (diff) | |
| download | rsyslog-85c13205190b29e2c188ed613d61730030cca9db.tar.gz rsyslog-85c13205190b29e2c188ed613d61730030cca9db.tar.xz rsyslog-85c13205190b29e2c188ed613d61730030cca9db.zip | |
Merge branch 'master-zmq'
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/statsobj.c | 12 | ||||
| -rw-r--r-- | runtime/statsobj.h | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/runtime/statsobj.c b/runtime/statsobj.c index a21614f6..25275616 100644 --- a/runtime/statsobj.c +++ b/runtime/statsobj.c @@ -168,15 +168,18 @@ finalize_it: /* get all the object's countes together as CEE. */ static rsRetVal -getStatsLineCEE(statsobj_t *pThis, cstr_t **ppcstr) +getStatsLineCEE(statsobj_t *pThis, cstr_t **ppcstr, int cee_cookie) { cstr_t *pcstr; ctr_t *pCtr; DEFiRet; CHKiRet(cstrConstruct(&pcstr)); - rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("@cee: {"), 7); + if (cee_cookie == 1) + rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("@cee: "), 6); + + rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("{"), 1); rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("name"), 4); rsCStrAppendStrWithLen(pcstr, UCHAR_CONSTANT("\""), 1); @@ -273,8 +276,11 @@ getAllStatsLines(rsRetVal(*cb)(void*, cstr_t*), void *usrptr, statsFmtType_t fmt case statsFmt_Legacy: CHKiRet(getStatsLine(o, &cstr)); break; + case statsFmt_CEE: + CHKiRet(getStatsLineCEE(o, &cstr, 1)); + break; case statsFmt_JSON: - CHKiRet(getStatsLineCEE(o, &cstr)); + CHKiRet(getStatsLineCEE(o, &cstr, 0)); break; } CHKiRet(cb(usrptr, cstr)); diff --git a/runtime/statsobj.h b/runtime/statsobj.h index f7de68ee..14b33215 100644 --- a/runtime/statsobj.h +++ b/runtime/statsobj.h @@ -46,7 +46,8 @@ typedef enum statsCtrType_e { /* stats line format types */ typedef enum statsFmtType_e { statsFmt_Legacy, - statsFmt_JSON + statsFmt_JSON, + statsFmt_CEE } statsFmtType_t; |
