-
Notifications
You must be signed in to change notification settings - Fork 82
/
threadmonitor.hh
43 lines (32 loc) · 940 Bytes
/
threadmonitor.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// -*- c-basic-offset: 4 -*-
#ifndef CLICK_THREADMONITOR_HH
#define CLICK_THREADMONITOR_HH
/*
* =c
* ThreadMonitor([INTERVAL, THRESH])
* =s threads
* print out thread status
* =d
*
* Every INTERVAL number of ms, print out tasks scheduled on each thread if
* tasks are busy. INTERVAL by default is 1000 ms. Only tasks with cycle count
* of at least THRESH are printed. By default THRESH is 1000 cycles.
*
* =a
* StaticThreadSched, BalancedThreadSched
*/
#include <click/element.hh>
#include <click/timer.hh>
class ThreadMonitor : public Element { public:
ThreadMonitor() CLICK_COLD;
~ThreadMonitor() CLICK_COLD;
const char *class_name() const override { return "ThreadMonitor"; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
void run_timer(Timer *);
private:
Timer _timer;
unsigned _interval;
unsigned _thresh;
};
#endif