Skip to content

Commit

Permalink
New metric to observe the thread cache size (#1558)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovalenti authored Feb 15, 2024
1 parent 1be54bc commit 6f91394
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions collector/lib/CollectorStatsExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ void CollectorStatsExporter::run() {
auto& preemptions = collectorEventCounters.Add({{"type", "preemptions"}});
auto& userspaceEvents = collectorEventCounters.Add({{"type", "userspace"}});
auto& grpcSendFailures = collectorEventCounters.Add({{"type", "grpcSendFailures"}});
auto& threadTableSize = collectorEventCounters.Add({{"type", "threadCacheSize"}});

auto& processSent = collectorEventCounters.Add({{"type", "processSent"}});
auto& processSendFailures = collectorEventCounters.Add({{"type", "processSendFailures"}});
Expand Down Expand Up @@ -213,6 +214,7 @@ void CollectorStatsExporter::run() {
kernel.Set(stats.nEvents);
drops.Set(stats.nDrops);
preemptions.Set(stats.nPreemptions);
threadTableSize.Set(stats.nThreadCacheSize);

uint64_t nUserspace = 0;
for (int i = 0; i < PPM_EVENT_MAX; i++) {
Expand Down
1 change: 1 addition & 0 deletions collector/lib/Sysdig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct SysdigStats {
volatile uint64_t nFilteredEvents[PPM_EVENT_MAX] = {0}; // events post filtering
volatile uint64_t nUserspaceEvents[PPM_EVENT_MAX] = {0}; // events processed by userspace
volatile uint64_t nGRPCSendFailures = 0; // number of signals that were not sent on GRPC
volatile uint64_t nThreadCacheSize = 0; // number of thread-info entries stored in the cache

// process related metrics
volatile uint64_t nProcessSent = 0; // number of process signals sent
Expand Down
1 change: 1 addition & 0 deletions collector/lib/SysdigService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ bool SysdigService::GetStats(SysdigStats* stats) const {
stats->nEvents = kernel_stats.n_evts;
stats->nDrops = kernel_stats.n_drops;
stats->nPreemptions = kernel_stats.n_preemptions;
stats->nThreadCacheSize = inspector_->m_thread_manager->get_thread_count();

return true;
}
Expand Down
1 change: 1 addition & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Units: occurence
| preemptions | Number of preemptions (?) |
| userspace[syscall] | Number of this kind of event |
| grpcSendFailures | (not used?) |
| threadCacheSize | Number of thread-info entries stored in the thread cache (sampled every 5s) |
| processSent | Process signal sent with success |
| processSendFailures | Failure upon sending a process signal |
| processResolutionFailuresByEvt | Count of invalid process signal events received, then ignored (invalid path or name, or not execve) |
Expand Down

0 comments on commit 6f91394

Please sign in to comment.