[ARVADOS] created: 2.1.0-1971-g1e3f7a2f0

Git user git at public.arvados.org
Fri Feb 25 21:37:22 UTC 2022


        at  1e3f7a2f014db8079e13d92a0ee978883c71503b (commit)


commit 1e3f7a2f014db8079e13d92a0ee978883c71503b
Author: Ward Vandewege <ward at curii.com>
Date:   Fri Feb 25 16:35:54 2022 -0500

    18805: replace unnecessary lookup of a constant.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/crunchstat/crunchstat.go b/lib/crunchstat/crunchstat.go
index 028083fa0..10cd7cfce 100644
--- a/lib/crunchstat/crunchstat.go
+++ b/lib/crunchstat/crunchstat.go
@@ -21,16 +21,6 @@ import (
 	"time"
 )
 
-// This magically allows us to look up userHz via _SC_CLK_TCK:
-
-/*
-#include <unistd.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <stdlib.h>
-*/
-import "C"
-
 // A Reporter gathers statistics for a cgroup and writes them to a
 // log.Logger.
 type Reporter struct {
@@ -395,7 +385,7 @@ func (r *Reporter) doCPUStats() {
 
 	var userTicks, sysTicks int64
 	fmt.Sscanf(string(b), "user %d\nsystem %d", &userTicks, &sysTicks)
-	userHz := float64(C.sysconf(C._SC_CLK_TCK))
+	userHz := float64(100)
 	nextSample := cpuSample{
 		hasData:    true,
 		sampleTime: time.Now(),

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list