projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b4415dd
)
formatting changes in cpusleep
author
Rinigus
<rinigus.git@gmail.com>
Tue, 19 Jul 2016 09:20:30 +0000
(12:20 +0300)
committer
Rinigus
<rinigus.git@gmail.com>
Tue, 19 Jul 2016 09:20:30 +0000
(12:20 +0300)
src/cpusleep.c
patch
|
blob
|
history
diff --git
a/src/cpusleep.c
b/src/cpusleep.c
index
bedc02a
..
e686550
100644
(file)
--- a/
src/cpusleep.c
+++ b/
src/cpusleep.c
@@
-38,7
+38,7
@@
SOFTWARE.
#include "plugin.h"
#include <time.h>
#include "plugin.h"
#include <time.h>
-static void cpusleep_submit
(derive_t cpu_sleep)
+static void cpusleep_submit(derive_t cpu_sleep)
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
@@
-47,23
+47,23
@@
static void cpusleep_submit (derive_t cpu_sleep)
vl.values = values;
vl.values_len = 1;
vl.values = values;
vl.values_len = 1;
- sstrncpy
(vl.host, hostname_g, sizeof (vl.host));
- sstrncpy
(vl.plugin, "cpusleep", sizeof (vl.plugin));
- sstrncpy
(vl.type, "cpusleep", sizeof (vl.type));
+ sstrncpy(vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy(vl.plugin, "cpusleep", sizeof (vl.plugin));
+ sstrncpy(vl.type, "cpusleep", sizeof (vl.type));
- plugin_dispatch_values
(&vl);
+ plugin_dispatch_values(&vl);
}
}
-static int cpusleep_read
(void)
+static int cpusleep_read(void)
{
struct timespec b, m;
{
struct timespec b, m;
- if ( clock_gettime(CLOCK_BOOTTIME, &b
) < 0 )
+ if ( clock_gettime(CLOCK_BOOTTIME, &b) < 0 )
{
ERROR("cpusleep plugin: clock_boottime failed");
return (-1);
}
{
ERROR("cpusleep plugin: clock_boottime failed");
return (-1);
}
- if ( clock_gettime(CLOCK_MONOTONIC, &m
) < 0 )
+ if ( clock_gettime(CLOCK_MONOTONIC, &m) < 0 )
{
ERROR("cpusleep plugin: clock_monotonic failed");
return (-1);
{
ERROR("cpusleep plugin: clock_monotonic failed");
return (-1);
@@
-76,12
+76,23
@@
static int cpusleep_read (void)
// derive is used
derive_t sleep = (derive_t) ((db-dm) * 1000);
// derive is used
derive_t sleep = (derive_t) ((db-dm) * 1000);
- cpusleep_submit
(sleep);
+ cpusleep_submit(sleep);
- return
0
;
+ return
(0)
;
}
}
-void module_register
(void)
+void module_register(void)
{
{
- plugin_register_read
("cpusleep", cpusleep_read);
+ plugin_register_read("cpusleep", cpusleep_read);
} /* void module_register */
} /* void module_register */
+
+
+/*
+ * Local variables:
+ * c-file-style: "gnu"
+ * indent-tabs-mode: nil
+ * c-indent-level: 4
+ * c-basic-offset: 2
+ * tab-width: 4
+ * End:
+ */