File: autoscaler.h

package info (click to toggle)
gnome-applets 3.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 40,820 kB
  • ctags: 2,628
  • sloc: ansic: 25,456; sh: 11,390; xml: 6,753; python: 1,725; makefile: 1,624
file content (26 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (9)
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
#ifndef GNOME_APPLETS_MULTILOAD_AUTOSCALER_H
#define GNOME_APPLETS_MULTILOAD_AUTOSCALER_H

#include <glib.h>
#include <time.h>

typedef struct _AutoScaler AutoScaler;

struct _AutoScaler
{
	/* const */ unsigned update_interval;
	/* const */ unsigned floor;
	unsigned max;
	unsigned count;
	time_t last_update;
	float sum;
	float last_average;
};


G_GNUC_INTERNAL void autoscaler_init(AutoScaler *that, unsigned interval, unsigned floor);

G_GNUC_INTERNAL unsigned autoscaler_get_max(AutoScaler *that, unsigned current);


#endif /* GNOME_APPLETS_MULTILOAD_AUTOSCALER_H */