Browse Source

Remove dead code

Run was not used, evetually it turned out to be not so useful.
Oz Tiram 5 years ago
parent
commit
8453ecc3d7
2 changed files with 0 additions and 24 deletions
  1. 0 7
      gupta.go
  2. 0 17
      gupta_test.go

+ 0 - 7
gupta.go

@@ -14,13 +14,6 @@ func Hello() string {
 	return fmt.Sprintf("Welcome to gupta version %s", version)
 }
 
-func Run(load, cpu, memory bool, partition, networkInterface string) (cpuLoad, cpuUsage, memoryUsage float64) {
-	cpuLoad = 0.2
-	cpuUsage = 0.2
-	memoryUsage = 70.0
-	return cpuLoad, cpuUsage, memoryUsage
-}
-
 type GuptaReport struct {
 	LoadAvarage float64
 	CPUUsage    *CPUStat `json:"cpu usage, omitempty"`

+ 0 - 17
gupta_test.go

@@ -15,23 +15,6 @@ func TestHello(t *testing.T) {
 	}
 }
 
-func TestRunGupta(t *testing.T) {
-	// test that we get CPU load
-	got := make([]float64, 3)
-	got[0], got[1], got[2] = Run(true, true, true, "", "")
-	want := []float64{0.2, 0.2, 70.0}
-
-	for i, v := range got {
-		if v != want[i] {
-			t.Errorf("got %v want %v", v, want[i])
-		}
-	}
-	// here it makes sense to return some kind of data structure
-	// with properties filled.
-	// having a data structure it would be possible to format
-	// it to json ...
-}
-
 func TestCPUStat(t *testing.T) {
 	//               0    1    2     3     4     5      6     7       8     9     10
 	//               cpu user nice system idle iowait  irq  softirq steal guest guest_nice