#define MAX_NAME 100
#define MAX_CMDLINE 1024
-unsigned long long Hertz = 1;
-
long processors = 1;
long pid_max = 32768;
int debug = 0;
return mpid;
}
-unsigned long long get_system_hertz(void)
-{
- unsigned long long myhz = 1;
-
-#ifdef _SC_CLK_TCK
- if((myhz = (unsigned long long int) sysconf(_SC_CLK_TCK)) > 0) {
- return myhz;
- }
-#endif
-
-#ifdef HZ
- myhz = HZ; /* <asm/param.h> */
-#else /* HZ */
- /* If 32-bit or big-endian (not Alpha or ia64), assume HZ is 100. */
- hz = (sizeof(long)==sizeof(int) || htons(999)==999) ? 100UL : 1024UL;
-#endif /* HZ */
-
- error("Unknown HZ value. Assuming %llu.", myhz);
- return myhz;
-}
-
-
// ----------------------------------------------------------------------------
// target
// target is the structure that process data are aggregated
else
snprintf(w->name, MAX_NAME, "%s", pw->pw_name);
- netdata_fix_id(w->name);
+ netdata_fix_chart_name(w->name);
w->uid = uid;
else
snprintf(w->name, MAX_NAME, "%s", gr->gr_name);
- netdata_fix_id(w->name);
+ netdata_fix_chart_name(w->name);
w->gid = gid;
for (w = root; w ; w = w->next) {
if(w->target || (!w->processes && !w->exposed)) continue;
- fprintf(stdout, "DIMENSION %s '' incremental 100 %llu %s\n", w->name, Hertz, w->hidden ? "hidden,noreset" : "noreset");
+ fprintf(stdout, "DIMENSION %s '' incremental 100 %u %s\n", w->name, hz, w->hidden ? "hidden,noreset" : "noreset");
}
fprintf(stdout, "CHART %s.mem '' '%s Dedicated Memory (w/o shared)' 'MB' mem %s.mem stacked 20003 %d\n", type, title, type, update_every);
for (w = root; w ; w = w->next) {
if(w->target || (!w->processes && !w->exposed)) continue;
- fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors);
+ fprintf(stdout, "DIMENSION %s '' incremental 100 %ld noreset\n", w->name, hz * processors);
}
fprintf(stdout, "CHART %s.cpu_system '' '%s CPU System Time (%ld%% = %ld core%s)' 'cpu time %%' cpu %s.cpu_system stacked 20021 %d\n", type, title, (processors * 100), processors, (processors>1)?"s":"", type, update_every);
for (w = root; w ; w = w->next) {
if(w->target || (!w->processes && !w->exposed)) continue;
- fprintf(stdout, "DIMENSION %s '' incremental 100 %llu noreset\n", w->name, Hertz * processors);
+ fprintf(stdout, "DIMENSION %s '' incremental 100 %ld noreset\n", w->name, hz * processors);
}
fprintf(stdout, "CHART %s.major_faults '' '%s Major Page Faults (swap read)' 'page faults/s' swap %s.major_faults stacked 20010 %d\n", type, title, type, update_every);
time_t started_t = time(NULL);
time_t current_t;
- Hertz = get_system_hertz();
+ get_HZ();
pid_max = get_system_pid_max();
processors = get_system_cpus();