Lines Matching refs:entry
40 static void UpdateStats(StatsEntry &entry, const StatsInfo &info)
44 ts_mono -= entry.monoTimeLast;
46 entry.monoTimeLast -= entry.monoTimeAuditStart;
47 float secs = entry.monoTimeLast.FloatSecs();
51 float freq = entry.tmpLines / secs;
52 if (freq > entry.freqMax) {
53 entry.freqMax = freq;
54 entry.realTimeFreqMax = entry.realTimeLast;
56 entry.tmpLines = 0;
57 float throughput = entry.tmpLen / secs;
58 if (throughput > entry.throughputMax) {
59 entry.throughputMax = throughput;
60 entry.realTimeThroughputMax = entry.realTimeLast;
62 entry.tmpLen = 0;
63 entry.monoTimeAuditStart.SetTimeStamp(info.mono_sec, info.tv_nsec);
67 entry.lines[lvl]++;
68 entry.len[lvl] += info.len;
69 entry.dropped += info.dropped;
70 entry.tmpLines++;
71 entry.tmpLen += info.len;
72 entry.monoTimeLast.SetTimeStamp(info.mono_sec, info.tv_nsec);
73 entry.realTimeLast.SetTimeStamp(info.tv_sec, info.tv_nsec);
76 static void ResetStatsEntry(StatsEntry &entry)
78 entry.dropped = 0;
79 entry.tmpLines = 0;
80 entry.freqMax = 0;
81 entry.realTimeFreqMax.SetTimeStamp(0, 0);
82 entry.tmpLen = 0;
83 entry.throughputMax = 0;
84 entry.realTimeThroughputMax.SetTimeStamp(0, 0);
85 entry.monoTimeLast.SetTimeStamp(0, 0);
86 entry.monoTimeAuditStart.SetTimeStamp(0, 0);
87 for (uint32_t &i : entry.lines) {
90 for (uint64_t &i : entry.len) {
95 static void StatsInfo2NewStatsEntry(const StatsInfo &info, StatsEntry &entry)
97 entry.dropped = info.dropped;
98 entry.tmpLines = 1;
99 entry.freqMax = 0;
100 entry.realTimeFreqMax.SetTimeStamp(info.tv_sec, info.tv_nsec);
101 entry.tmpLen = info.len;
102 entry.throughputMax = 0;
103 entry.realTimeThroughputMax.SetTimeStamp(info.tv_sec, info.tv_nsec);
104 entry.realTimeLast.SetTimeStamp(info.tv_sec, info.tv_nsec);
105 entry.monoTimeLast.SetTimeStamp(info.mono_sec, info.tv_nsec);
106 entry.monoTimeAuditStart.SetTimeStamp(info.mono_sec, info.tv_nsec);
107 for (uint32_t &i : entry.lines) {
110 for (uint64_t &i : entry.len) {
114 entry.lines[lvl] = 1;
115 entry.len[lvl] = info.len;
127 TagStatsEntry entry;
128 StatsInfo2NewStatsEntry(info, entry);
129 (void)tt.emplace(info.tag, entry);
140 DomainStatsEntry entry;
141 StatsInfo2NewStatsEntry(info, entry.stats);
142 auto result = t.emplace(info.domain, entry);
144 cerr << "Add entry to DomainTable error" << endl;
160 PidStatsEntry entry;
161 StatsInfo2NewStatsEntry(info, entry.statsAll);
162 for (StatsEntry &e : entry.stats) {
165 entry.stats[info.type] = entry.statsAll;
166 entry.name = GetNameByPid(info.pid);
167 auto result = t.emplace(info.pid, entry);
169 cerr << "Add entry to PidTable error" << endl;