MCPcopy Create free account
hub / github.com/apache/trafficserver / statAdd

Function statAdd

plugins/experimental/system_stats/system_stats.cc:101–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static int
102statAdd(const char *name, TSRecordDataType record_type, TSMutex create_mutex)
103{
104 int stat_id = -1;
105
106 TSMutexLock(create_mutex);
107
108 if (TS_ERROR == TSStatFindName(name, &stat_id)) {
109 stat_id = TSStatCreate(name, record_type, TS_STAT_NON_PERSISTENT, TS_STAT_SYNC_SUM);
110 if (stat_id == TS_ERROR) {
111 Dbg(dbg_ctl, "Error creating stat_name: %s", name);
112 } else {
113 Dbg(dbg_ctl, "Created stat_name: %s stat_id: %d", name, stat_id);
114 }
115 }
116
117 TSMutexUnlock(create_mutex);
118
119 return stat_id;
120}
121
122static ssize_t
123getFile(const char *filename, char *buffer, size_t bufferSize)

Callers 1

statSetFunction · 0.85

Calls 4

TSMutexLockFunction · 0.85
TSStatFindNameFunction · 0.85
TSStatCreateFunction · 0.85
TSMutexUnlockFunction · 0.85

Tested by

no test coverage detected