update
parent
5c6b6b0655
commit
710e15b018
|
@ -72,7 +72,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
for (;;)
|
||||
{
|
||||
get_current_netload(&data, &in, &out, &tot);
|
||||
get_current_speed(&data, &in, &out, &tot);
|
||||
format_byte_humanreadable(bufIn, 20, (double)in, 0, FALSE);
|
||||
format_byte_humanreadable(bufOut, 20, (double)out, 0, FALSE);
|
||||
format_byte_humanreadable(bufTot, 20, (double)tot, 2, TRUE);
|
||||
|
|
|
@ -82,14 +82,14 @@ int init_netload(netdata* data, const char* device)
|
|||
|
||||
data->correct_interface = TRUE;
|
||||
|
||||
DBG("The netload plugin was initialized for '%s'.", device);
|
||||
DBG("The speed plugin was initialized for '%s'.", device);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
void get_current_netload(netdata* data, unsigned long *in, unsigned long *out, unsigned long *tot)
|
||||
void get_current_speed(netdata* data, unsigned long *in, unsigned long *out, unsigned long *tot)
|
||||
{
|
||||
struct timeval curr_time;
|
||||
double delta_t;
|
||||
|
|
|
@ -85,7 +85,7 @@ int init_netload(netdata* data, const char* device);
|
|||
* @param out Output load in byte/s.
|
||||
* @param tot Total load in byte/s.
|
||||
*/
|
||||
void get_current_netload(netdata* data, unsigned long *in, unsigned long *out, unsigned long *tot);
|
||||
void get_current_speed(netdata* data, unsigned long *in, unsigned long *out, unsigned long *tot);
|
||||
|
||||
/**
|
||||
* Returns the name of the network interface.
|
||||
|
|
|
@ -173,7 +173,7 @@ static gboolean update_monitors(gpointer user_data)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
get_current_netload( &(global->monitor->data), &(net[IN]), &(net[OUT]), &(net[TOT]) );
|
||||
get_current_speed( &(global->monitor->data), &(net[IN]), &(net[OUT]), &(net[TOT]) );
|
||||
|
||||
|
||||
for (i = 0; i < SUM; i++)
|
||||
|
|
|
@ -78,7 +78,7 @@ char* format_byte_humanreadable(char* string, int stringsize, double number, int
|
|||
char* str = string;
|
||||
char buffer[BUFSIZ], formatstring[BUFSIZ];
|
||||
char* bufptr = buffer;
|
||||
char* unit_names[] = { N_("B"), N_("KiB"), N_("MiB"), N_("GiB") };
|
||||
char* unit_names[] = { N_("B/s"), N_("K/s"), N_("M/s"), N_("G/s") };
|
||||
char* unit_names_bits[] = { N_("bps"), N_("Kbps"), N_("Mbps"), N_("Gbps") };
|
||||
unsigned int uidx = 0;
|
||||
double number_displayed = 0;
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
#ifndef LINUX_H
|
||||
#define LINUX_H
|
||||
|
||||
#include "../net.h"
|
||||
|
||||
void init_osspecific(netdata* data);
|
||||
int checkinterface(netdata* data);
|
||||
int get_stat(netdata* data);
|
||||
|
||||
#ifdef __linux__
|
||||
#define BUFSIZE 256
|
||||
#endif /* _linux_ */
|
||||
|
||||
#endif /* LINUX_H */
|
||||
#define BUFSIZE 256
|
Loading…
Reference in New Issue