From 7073cc64df6d4aa344f52e7db3f3a9c5289071bc Mon Sep 17 00:00:00 2001 From: Alexey Kostin Date: Fri, 15 Feb 2019 20:08:00 +0300 Subject: [PATCH] Logical fix --- ceph-gobench.go | 8 ++++---- types.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ceph-gobench.go b/ceph-gobench.go index 62cb355..6bdf058 100644 --- a/ceph-gobench.go +++ b/ceph-gobench.go @@ -26,7 +26,7 @@ func get_pool_size(cephconn *Cephconnection, params *Params) *Monanswer { } -func get_pg_by_pool(cephconn *Cephconnection, params *Params) *[]PlacementGroups { +func get_pg_by_pool(cephconn *Cephconnection, params *Params) *[]PlacementGroup { monjson, err := json.Marshal(Moncommand{Prefix: "pg ls-by-pool", Poolstr: params.pool, Format: "json"}) if err != nil { log.Fatalf("Can't marshal json mon query. Error: %v", err) @@ -36,7 +36,7 @@ func get_pg_by_pool(cephconn *Cephconnection, params *Params) *[]PlacementGroups log.Fatalf("Failed exec monCommand. Error: %v", err) } - monanswer := []PlacementGroups{} + monanswer := []PlacementGroup{} if err := json.Unmarshal([]byte(monrawanswer), &monanswer); err != nil { log.Fatalf("Can't parse monitor answer. Error: %v", err) } @@ -73,7 +73,7 @@ func main() { monanswersize.Pool, monanswersize.Size, monanswersize.Pool, monanswersize.Pool) } - monanswerpgs := get_pg_by_pool(cephconn, params) - log.Println(monanswerpgs) + placementGroups := get_pg_by_pool(cephconn, params) + log.Println(placementGroups) } diff --git a/types.go b/types.go index 5fc2976..9f28c46 100644 --- a/types.go +++ b/types.go @@ -32,7 +32,7 @@ type Monanswer struct { Size int `json:"size,omitempty"` } -func (times *PlacementGroups) StringsToTimes() { +func (times *PlacementGroup) StringsToTimes() { const LongForm = "2006-01-02 15:04:05.000000" times.Last_fresh, _ = time.Parse(LongForm, times.Last_fresh_str) times.Last_change, _ = time.Parse(LongForm, times.Last_fresh_str) @@ -51,7 +51,7 @@ func (times *PlacementGroups) StringsToTimes() { times.Last_scrub, _ = time.Parse(LongForm, times.Last_scrub_str) } -type PlacementGroups struct { +type PlacementGroup struct { Pgid string `json:"pgid"` Version string `json:"version"` Reported_seq string `json:"reported_seq"`