kostya-sigar 1.8.7 → 1.8.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d832b4da9c243bcd5fd904bf468c5a037aabf7b
4
- data.tar.gz: d87517ce49ed465874a947daac4e245ade352b7f
3
+ metadata.gz: 85767451a1bf1803940ded1fd7165c4065db46f3
4
+ data.tar.gz: d289fe077a5d4c142d00e4feca14beeb4a29dbe7
5
5
  SHA512:
6
- metadata.gz: 5550b885b8abe3e435f1d503ed8f356cb05cf101b5f546df2bc78e5849b53bafc168699d6f6bb91cbedde5db0af03e8762cc098efab3433cf42cb2e2ceac1709
7
- data.tar.gz: a65167b661f5d042c6b5abc6722c2e8fc65a28f7057cefa9d5ffc37e654d0631bf0a69994ddb34ed1d984c1bffffb5f0586be1925c6f1efb7a05dd2e9a23c121
6
+ metadata.gz: 0f3f1a018f9182a69bc0c18cdd1334bbb17aa0d0a025e8c34ee0ceb08f1f3d066488492e46896015a9a85d52a673d526d88da2d8825899b86b1efc7d32976642
7
+ data.tar.gz: c43c6e68e84187ec8c01d6e4470f3bf9f82ddf46a522207463747ec74c7321397bb0a229216d41cc7b100383afeb0725fa14cc903dc1c2e1e84a125518a06183
@@ -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
- FILE *fp;
128
- char buffer[BUFSIZ], *ptr;
129
- int found = 0;
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
- if (!(fp = fopen(PROC_STAT, "r"))) {
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
@@ -1,7 +1,7 @@
1
1
  copyright.year=2004-2011
2
2
  version.major=1
3
3
  version.minor=8
4
- version.maint=7
4
+ version.maint=8
5
5
  version.build=0
6
6
  project.name=kostya-sigar
7
7
  project.author=Doug MacEachern
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.7
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-20 00:00:00.000000000 Z
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