diff options
author | Janoš Guljaš <janos@users.noreply.github.com> | 2019-04-25 16:22:57 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-05-10 18:26:33 +0800 |
commit | c1213bd00c2a84a9dfc218e44cc2f85902f91128 (patch) | |
tree | 2f3123b72dbe448ec28fd5175e146c191112c7c9 /swarm/chunk/chunk.go | |
parent | 993b145f25845e50e8af41ffb1116eaee381d693 (diff) | |
download | go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.tar go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.tar.gz go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.tar.bz2 go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.tar.lz go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.tar.xz go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.tar.zst go-tangerine-c1213bd00c2a84a9dfc218e44cc2f85902f91128.zip |
swarm: LocalStore metrics
* swarm/shed: remove metrics fields from DB struct
* swarm/schunk: add String methods to modes
* swarm/storage/localstore: add metrics and traces
* swarm/chunk: unknown modes without spaces in String methods
* swarm/storage/localstore: remove bin number from pull subscription metrics
* swarm/storage/localstore: add resetting time metrics and code improvements
Diffstat (limited to 'swarm/chunk/chunk.go')
-rw-r--r-- | swarm/chunk/chunk.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/swarm/chunk/chunk.go b/swarm/chunk/chunk.go index 2455904f3..9ae59c95f 100644 --- a/swarm/chunk/chunk.go +++ b/swarm/chunk/chunk.go @@ -112,6 +112,19 @@ func Proximity(one, other []byte) (ret int) { // ModeGet enumerates different Getter modes. type ModeGet int +func (m ModeGet) String() string { + switch m { + case ModeGetRequest: + return "Request" + case ModeGetSync: + return "Sync" + case ModeGetLookup: + return "Lookup" + default: + return "Unknown" + } +} + // Getter modes. const ( // ModeGetRequest: when accessed for retrieval @@ -125,6 +138,19 @@ const ( // ModePut enumerates different Putter modes. type ModePut int +func (m ModePut) String() string { + switch m { + case ModePutRequest: + return "Request" + case ModePutSync: + return "Sync" + case ModePutUpload: + return "Upload" + default: + return "Unknown" + } +} + // Putter modes. const ( // ModePutRequest: when a chunk is received as a result of retrieve request and delivery @@ -138,6 +164,19 @@ const ( // ModeSet enumerates different Setter modes. type ModeSet int +func (m ModeSet) String() string { + switch m { + case ModeSetAccess: + return "Access" + case ModeSetSync: + return "Sync" + case ModeSetRemove: + return "Remove" + default: + return "Unknown" + } +} + // Setter modes. const ( // ModeSetAccess: when an update request is received for a chunk or chunk is retrieved for delivery |