Skip to content

Commit

Permalink
#43 Removed unused memory status
Browse files Browse the repository at this point in the history
  • Loading branch information
eidekrist committed Dec 21, 2018
1 parent 66d57e6 commit 0f0230e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
3 changes: 0 additions & 3 deletions cse/cse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"cse-server-go/metadata"
"cse-server-go/structs"
"fmt"
"github.com/shirou/gopsutil/mem"
"io/ioutil"
"log"
"math"
Expand Down Expand Up @@ -424,7 +423,6 @@ func GetSignalValue(module string, cardinality string, signal string) int {
func SimulationStatus(simulationStatus *structs.SimulationStatus, sim *Simulation) structs.JsonResponse {
simulationStatus.Mutex.Lock()
defer simulationStatus.Mutex.Unlock()
virtualMemoryStats, _ := mem.VirtualMemory()
if simulationStatus.Loaded {
execStatus := getExecutionStatus(sim.Execution)
return structs.JsonResponse{
Expand All @@ -437,7 +435,6 @@ func SimulationStatus(simulationStatus *structs.SimulationStatus, sim *Simulatio
Status: simulationStatus.Status,
ConfigDir: simulationStatus.ConfigDir,
TrendSignals: simulationStatus.TrendSignals,
Memory: virtualMemoryStats,
}
} else {
return structs.JsonResponse{
Expand Down
18 changes: 8 additions & 10 deletions structs/structs.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package structs

import (
"github.com/shirou/gopsutil/mem"
"sync"
)

Expand All @@ -18,15 +17,14 @@ type Module struct {
}

type JsonResponse struct {
Loaded bool `json:"loaded"`
SimulationTime float64 `json:"time"`
RealTimeFactor float64 `json:"realTimeFactor"`
IsRealTimeSimulation bool `json:"isRealTime"`
ConfigDir string `json:"configDir,omitempty"`
Status string `json:"status,omitempty"`
Modules []string `json:"modules"`
Module Module `json:"module,omitempty"`
Memory *mem.VirtualMemoryStat
Loaded bool `json:"loaded"`
SimulationTime float64 `json:"time"`
RealTimeFactor float64 `json:"realTimeFactor"`
IsRealTimeSimulation bool `json:"isRealTime"`
ConfigDir string `json:"configDir,omitempty"`
Status string `json:"status,omitempty"`
Modules []string `json:"modules"`
Module Module `json:"module,omitempty"`
TrendSignals []TrendSignal `json:"trend-values"`
}

Expand Down

0 comments on commit 0f0230e

Please sign in to comment.