forked from pulse-vadc/go-vtm
-
Notifications
You must be signed in to change notification settings - Fork 2
/
statistics_cache_web_cache.go
50 lines (46 loc) · 1.87 KB
/
statistics_cache_web_cache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2018-2019, Pulse Secure, LLC.
// Licensed under the terms of the MPL 2.0. See LICENSE file for details.
// Go library for Pulse Virtual Traffic Manager REST version 5.2.
package vtm
import (
"encoding/json"
)
type CacheWebCacheStatistics struct {
Statistics struct {
Entries *int `json:"entries"`
HitRate *int `json:"hit_rate"`
Hits *int `json:"hits"`
HitsHi *int `json:"hits_hi"`
HitsLo *int `json:"hits_lo"`
Lookups *int `json:"lookups"`
LookupsHi *int `json:"lookups_hi"`
LookupsLo *int `json:"lookups_lo"`
MaxEntries *int `json:"max_entries"`
MemMaximum *int `json:"mem_maximum"`
MemUsed *int `json:"mem_used"`
Misses *int `json:"misses"`
MissesHi *int `json:"misses_hi"`
MissesLo *int `json:"misses_lo"`
Oldest *int `json:"oldest"`
UrlStoreAllocated *int `json:"url_store_allocated"`
UrlStoreFree *int `json:"url_store_free"`
UrlStoreSize *int `json:"url_store_size"`
UrlStoreTotalAllocations *int `json:"url_store_total_allocations"`
UrlStoreTotalFailures *int `json:"url_store_total_failures"`
UrlStoreTotalFrees *int `json:"url_store_total_frees"`
} `json:"statistics"`
}
func (vtm VirtualTrafficManager) GetCacheWebCacheStatistics() (*CacheWebCacheStatistics, *vtmErrorResponse) {
conn := vtm.connector.getChildConnector("/tm/5.2/status/local_tm/statistics/cache/web_cache")
data, ok := conn.get()
if ok != true {
object := new(vtmErrorResponse)
json.NewDecoder(data).Decode(object)
return nil, object
}
object := new(CacheWebCacheStatistics)
if err := json.NewDecoder(data).Decode(object); err != nil {
panic(err)
}
return object, nil
}