kostya-sigar 1.8.7 → 1.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/src/os/linux/linux_sigar.c +5 -33
- data/src/sigar_util.c +0 -16
- data/version.properties +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85767451a1bf1803940ded1fd7165c4065db46f3
|
|
4
|
+
data.tar.gz: d289fe077a5d4c142d00e4feca14beeb4a29dbe7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0f3f1a018f9182a69bc0c18cdd1334bbb17aa0d0a025e8c34ee0ceb08f1f3d066488492e46896015a9a85d52a673d526d88da2d8825899b86b1efc7d32976642
|
|
7
|
+
data.tar.gz: c43c6e68e84187ec8c01d6e4470f3bf9f82ddf46a522207463747ec74c7321397bb0a229216d41cc7b100383afeb0725fa14cc903dc1c2e1e84a125518a06183
|
data/src/os/linux/linux_sigar.c
CHANGED
|
@@ -124,30 +124,11 @@ sigar_pid_t sigar_pid_get(sigar_t *sigar)
|
|
|
124
124
|
|
|
125
125
|
static int sigar_boot_time_get(sigar_t *sigar)
|
|
126
126
|
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
unsigned long seconds_since_1970 = time(NULL);
|
|
128
|
+
sigar_uptime_t seconds_since_boot;
|
|
129
|
+
sigar_uptime_get(sigar, &seconds_since_boot);
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
return errno;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
while ((ptr = fgets(buffer, sizeof(buffer), fp))) {
|
|
136
|
-
if (strnEQ(ptr, "btime", 5)) {
|
|
137
|
-
if ((ptr = sigar_skip_token(ptr))) {
|
|
138
|
-
sigar->boot_time = sigar_strtoul(ptr);
|
|
139
|
-
found = 1;
|
|
140
|
-
}
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
fclose(fp);
|
|
146
|
-
|
|
147
|
-
if (!found) {
|
|
148
|
-
/* should never happen */
|
|
149
|
-
sigar->boot_time = time(NULL);
|
|
150
|
-
}
|
|
131
|
+
sigar->boot_time = seconds_since_1970 - (unsigned long)seconds_since_boot;
|
|
151
132
|
|
|
152
133
|
return SIGAR_OK;
|
|
153
134
|
}
|
|
@@ -848,16 +829,7 @@ int sigar_proc_time_get(sigar_t *sigar, sigar_pid_t pid,
|
|
|
848
829
|
proctime->user = pstat->utime;
|
|
849
830
|
proctime->sys = pstat->stime;
|
|
850
831
|
proctime->total = proctime->user + proctime->sys;
|
|
851
|
-
|
|
852
|
-
// --- Added by kostya:
|
|
853
|
-
// calculate start time by /proc/pid creation time
|
|
854
|
-
// previous calculation was bad because when time on server changed,
|
|
855
|
-
// sigar not updating it
|
|
856
|
-
char name[BUFSIZ];
|
|
857
|
-
(void)SIGAR_PROC_FILENAME(name, pid, "");
|
|
858
|
-
proctime->start_time = (sigar_uint64_t)file_birthtime(name);
|
|
859
|
-
proctime->start_time *= 1000;
|
|
860
|
-
// --- Added by kostya:
|
|
832
|
+
proctime->start_time = pstat->start_time;
|
|
861
833
|
|
|
862
834
|
return SIGAR_OK;
|
|
863
835
|
}
|
data/src/sigar_util.c
CHANGED
|
@@ -1058,19 +1058,3 @@ sigar_int64_t sigar_time_now_millis(void)
|
|
|
1058
1058
|
return ((tv.tv_sec * SIGAR_USEC) + tv.tv_usec) / SIGAR_MSEC;
|
|
1059
1059
|
}
|
|
1060
1060
|
#endif
|
|
1061
|
-
|
|
1062
|
-
#ifdef __linux__
|
|
1063
|
-
|
|
1064
|
-
#include <sys/stat.h>
|
|
1065
|
-
#ifdef HAVE_ST_BIRTHTIME
|
|
1066
|
-
#define birthtime(x) x.st_birthtime
|
|
1067
|
-
#else
|
|
1068
|
-
#define birthtime(x) x.st_ctime
|
|
1069
|
-
#endif
|
|
1070
|
-
|
|
1071
|
-
sigar_int64_t file_birthtime(char* filename) {
|
|
1072
|
-
struct stat st;
|
|
1073
|
-
if (stat(filename, &st) != 0) return 0; else return birthtime(st);
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
#endif
|
data/version.properties
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kostya-sigar
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.
|
|
4
|
+
version: 1.8.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Doug MacEachern
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-01-
|
|
11
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: System Information Gatherer And Reporter
|
|
14
14
|
email: sigar-users@hyperic.org
|