Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into hotfix/pjy_expres…
Browse files Browse the repository at this point in the history
…sion_filter
  • Loading branch information
Counterflowwind committed Aug 16, 2021
2 parents c405143 + 4ba723a commit c7c8541
Show file tree
Hide file tree
Showing 16 changed files with 1,164 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO `sp_dashboard_block_system` (`id`, `name`, `desc`, `domain`, `scope`, `scope_id`, `view_config`, `data_config`, `version`) VALUES ('working_en', 'working_ statistics', '', '', 'org', 'terminus', '[{\"w\":12,\"h\":9,\"x\":0,\"y\":0,\"i\":\"view-98ae03fd\",\"view\":{\"title\":\"actual workload (MD)\",\"description\":\"\",\"chartType\":\"card\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics\",\"query\":{\"alias_sum.issue_elapsed_time\":\"issue_elapsed_time总和\",\"chartType\":\"card\",\"format\":\"chartv2\",\"sum\":[\"issue_elapsed_time\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"5\",\"metric\":\"issue_metrics_statistics-issue_elapsed_time\"}],\"filters\":[],\"group\":[]}}}},{\"w\":12,\"h\":9,\"x\":12,\"y\":0,\"i\":\"view-73d60bcb\",\"view\":{\"title\":\"estimated workload (MD)\",\"description\":\"\",\"chartType\":\"card\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics\",\"query\":{\"alias_sum.issue_estimate_time\":\"issue_estimate_time总和\",\"chartType\":\"card\",\"format\":\"chartv2\",\"sum\":[\"issue_estimate_time\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"16\",\"metric\":\"issue_metrics_statistics-issue_estimate_time\"}],\"filters\":[],\"group\":[]}}}},{\"w\":24,\"h\":9,\"x\":0,\"y\":9,\"i\":\"view-cdb72329\",\"view\":{\"title\":\"member workload distribution (MD)\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_user_nick\":\"issue_user_nick\",\"alias_sum.issue_elapsed_time\":\"issue_elapsed_time总和\",\"alias_sum.issue_estimate_time\":\"issue_estimate_time总和\",\"chartType\":\"chart:bar\",\"format\":\"chartv2\",\"limit\":1000,\"group\":\"(tags.issue_user_nick)\",\"sum\":[\"issue_estimate_time\",\"issue_elapsed_time\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"50\",\"metric\":\"issue_metrics_statistics-issue_estimate_time\"},{\"aggregation\":\"sum\",\"key\":\"40\",\"metric\":\"issue_metrics_statistics-issue_elapsed_time\"}],\"filters\":[],\"group\":[\"tags.issue_user_nick\"]}}}},{\"w\":12,\"h\":9,\"x\":0,\"y\":28,\"i\":\"view-2161e559\",\"view\":{\"title\":\"BUG time consuming TOP10 (MD)\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_title\":\"issue_title\",\"alias_sum.issue_elapsed_time\":\"issue_elapsed_time总和\",\"chartType\":\"chart:bar\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\",\"group\":\"(tags.issue_title)\",\"limit\":10,\"sort\":\"sum_issue_elapsed_time\",\"sum\":[\"issue_elapsed_time\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"235\",\"metric\":\"issue_metrics_statistics-issue_elapsed_time\"}],\"filters\":[{\"key\":\"245\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[\"tags.issue_title\"],\"limit\":10}}}},{\"w\":12,\"h\":9,\"x\":12,\"y\":28,\"i\":\"view-1e55a4eb\",\"view\":{\"title\":\"task time consuming TOP10 (MD)\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_title\":\"issue_title\",\"alias_sum.issue_elapsed_time\":\"issue_elapsed_time总和\",\"chartType\":\"chart:bar\",\"eq_tags.issue_type\":\"TASK\",\"format\":\"chartv2\",\"group\":\"(tags.issue_title)\",\"limit\":10,\"sort\":\"sum_issue_elapsed_time\",\"sum\":[\"issue_elapsed_time\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"347\",\"metric\":\"issue_metrics_statistics-issue_elapsed_time\"}],\"filters\":[{\"key\":\"357\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"TASK\"}],\"group\":[\"tags.issue_title\"],\"limit\":10}}}},{\"w\":24,\"h\":10,\"x\":0,\"y\":18,\"i\":\"view-970a9935\",\"view\":{\"title\":\"Personnel incident distribution (num)\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_user_nick\":\"issue_user_nick\",\"alias_sum.issue_type_BUG\":\"issue_type_BUG总和\",\"alias_sum.issue_type_TASK\":\"issue_type_TASK总和\",\"chartType\":\"chart:bar\",\"format\":\"chartv2\",\"limit\":1000,\"group\":\"(tags.issue_user_nick)\",\"sum\":[\"issue_type_TASK\",\"issue_type_BUG\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"659\",\"metric\":\"issue_metrics_statistics-issue_type_TASK\"},{\"aggregation\":\"sum\",\"key\":\"649\",\"metric\":\"issue_metrics_statistics-issue_type_BUG\"}],\"filters\":[],\"group\":[\"tags.issue_user_nick\"]}}}}]', '[]', '');
INSERT INTO `sp_dashboard_block_system` (`id`, `name`, `desc`, `domain`, `scope`, `scope_id`, `view_config`, `data_config`, `version`) VALUES ('bug_en', 'bug_statistics', '', '', 'org', 'terminus', '[{\"w\":12,\"h\":10,\"x\":0,\"y\":0,\"i\":\"view-f6623ce7\",\"view\":{\"title\":\"bug are distributed by state\",\"description\":\"\",\"chartType\":\"chart:pie\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics\",\"query\":{\"alias_last.tags.issue_state\":\"issue_state\",\"alias_sum.counts\":\"counts总和\",\"chartType\":\"chart:pie\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\",\"trans_group\":\"true\",\"group\":\"(tags.issue_state)\",\"sum\":[\"counts\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"691\",\"metric\":\"issue_metrics_statistics-counts\"}],\"filters\":[{\"key\":\"9\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[\"tags.issue_state\"]}},\"controls\":null}},{\"w\":24,\"h\":9,\"x\":0,\"y\":10,\"i\":\"view-fd2ecfbe\",\"view\":{\"title\":\"bug add/Close trend\",\"description\":\"\",\"chartType\":\"chart:line\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":true,\"noAreaColor\":true,\"moreThanOneDayFormat\":\"M/D\"},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_add_or_repair_metrics_statistics/histogram\",\"query\":{\"chartType\":\"chart:line\",\"interval\":\"24h\",\"format\":\"chartv2\",\"start\":\"${start}\",\"end\":\"${end}\",\"sum\":[\"bug_add_counts\",\"bug_repair_counts\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_add_or_repair_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"263\",\"metric\":\"issue_add_or_repair_metrics_statistics-bug_add_or_repair_counts\"}],\"filters\":[],\"group\":[\"tags.bug_add_or_repair_type\"]}},\"controls\":[{}]}},{\"w\":12,\"h\":10,\"x\":12,\"y\":0,\"i\":\"view-1e86c4a6\",\"view\":{\"title\":\"bug Distribution by severity level\",\"description\":\"\",\"chartType\":\"chart:pie\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics\",\"query\":{\"alias_last.tags.issue_severity\":\"issue_severity\",\"alias_sum.counts\":\"counts总和\",\"chartType\":\"chart:pie\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\",\"trans_group\":\"true\",\"group\":\"(tags.issue_severity)\",\"sum\":[\"counts\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"459\",\"metric\":\"issue_metrics_statistics-counts\"}],\"filters\":[{\"key\":\"24\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[\"tags.issue_severity\"]}},\"controls\":null}},{\"w\":12,\"h\":5,\"x\":12,\"y\":37,\"i\":\"view-91fd7d1f\",\"view\":{\"title\":\"bug defect response time (MD)\",\"description\":\"\",\"chartType\":\"card\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics\",\"query\":{\"alias_avg.issue_response_time\":\"issue_response_time平均值\",\"avg\":[\"issue_response_time\"],\"chartType\":\"card\",\"eq_tags.issue_state\":\"CLOSED\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\"},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"avg\",\"key\":\"604\",\"metric\":\"issue_metrics_statistics-issue_response_time\"}],\"filters\":[{\"key\":\"346\",\"method\":\"eq\",\"tag\":\"tags.issue_state\",\"value\":\"CLOSED\"},{\"key\":\"84\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[]}},\"controls\":null}},{\"w\":12,\"h\":5,\"x\":0,\"y\":37,\"i\":\"view-d8d99372\",\"view\":{\"title\":\"bug average repair workload(MD)\",\"description\":\"\",\"chartType\":\"card\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics\",\"query\":{\"alias_avg.issue_elapsed_time\":\"issue_elapsed_time平均值\",\"avg\":[\"issue_elapsed_time\"],\"chartType\":\"card\",\"eq_tags.issue_state\":\"CLOSED\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\"},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"avg\",\"key\":\"308\",\"metric\":\"issue_metrics_statistics-issue_elapsed_time\"}],\"filters\":[{\"key\":\"269\",\"method\":\"eq\",\"tag\":\"tags.issue_state\",\"value\":\"CLOSED\"},{\"key\":\"191\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[]}},\"controls\":null}},{\"w\":24,\"h\":10,\"x\":0,\"y\":42,\"i\":\"view-8b1ee412\",\"view\":{\"title\":\"bug distribution by priority\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_user_nick\":\"issue_user_nick\",\"alias_sum.counts\":\"counts总和\",\"alias_sum.not_close\":\"not_close总和\",\"chartType\":\"chart:bar\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\",\"limit\":1000,\"group\":\"(tags.issue_user_nick)\",\"sum\":[\"not_close\",\"counts\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"170\",\"metric\":\"issue_metrics_statistics-not_close\"},{\"aggregation\":\"sum\",\"key\":\"154\",\"metric\":\"issue_metrics_statistics-counts\"}],\"filters\":[{\"key\":\"269\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[\"tags.issue_user_nick\"]}},\"controls\":[{\"key\":\"eq_tags.issue_priority\",\"options\":[{\"name\":\"low\",\"value\":\"LOW\"},{\"name\":\"normal\",\"value\":\"NORMAL\"},{\"name\":\"high\",\"value\":\"HIGH\"},{\"name\":\"urgent\",\"value\":\"URGENT\"}],\"type\":\"select\"}]}},{\"w\":24,\"h\":9,\"x\":0,\"y\":28,\"i\":\"view-a844c5b7\",\"view\":{\"title\":\"bug press to reopen the distribution\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_user_nick\":\"issue_user_nick\",\"alias_sum.is_re_open_FATAL\":\"is_re_open_FATAL总和\",\"alias_sum.is_re_open_NORMAL\":\"is_re_open_NORMAL总和\",\"alias_sum.is_re_open_SERIOUS\":\"is_re_open_SERIOUS总和\",\"alias_sum.is_re_open_SLIGHT\":\"is_re_open_SLIGHT总和\",\"alias_sum.is_re_open_SUGGEST\":\"is_re_open_SUGGEST总和\",\"chartType\":\"chart:bar\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\",\"limit\":1000,\"group\":\"(tags.issue_user_nick)\",\"sum\":[\"is_re_open_SUGGEST\",\"is_re_open_SLIGHT\",\"is_re_open_SERIOUS\",\"is_re_open_NORMAL\",\"is_re_open_FATAL\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"1755\",\"metric\":\"issue_metrics_statistics-is_re_open_SUGGEST\"},{\"aggregation\":\"sum\",\"key\":\"1721\",\"metric\":\"issue_metrics_statistics-is_re_open_SLIGHT\"},{\"aggregation\":\"sum\",\"key\":\"1687\",\"metric\":\"issue_metrics_statistics-is_re_open_SERIOUS\"},{\"aggregation\":\"sum\",\"key\":\"1653\",\"metric\":\"issue_metrics_statistics-is_re_open_NORMAL\"},{\"aggregation\":\"sum\",\"key\":\"1637\",\"metric\":\"issue_metrics_statistics-is_re_open_FATAL\"}],\"filters\":[{\"key\":\"1871\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[\"tags.issue_user_nick\"]}},\"controls\":null}},{\"w\":24,\"h\":9,\"x\":0,\"y\":19,\"i\":\"view-7fb8a372\",\"view\":{\"title\":\"bug distribution by personnel\",\"description\":\"\",\"chartType\":\"chart:bar\",\"dataSourceType\":\"api\",\"staticData\":{},\"config\":{\"optionProps\":{\"isMoreThanOneDay\":false},\"option\":{\"yAxis\":[{\"name\":\"\"}]}},\"api\":{\"url\":\"/api/project/metrics/issue_metrics_statistics/histogram\",\"query\":{\"alias_last.tags.issue_user_nick\":\"issue_user_nick\",\"alias_sum.counts\":\"counts总和\",\"alias_sum.not_close\":\"not_close总和\",\"chartType\":\"chart:bar\",\"eq_tags.issue_type\":\"BUG\",\"format\":\"chartv2\",\"limit\":1000,\"group\":\"(tags.issue_user_nick)\",\"sum\":[\"not_close\",\"counts\"]},\"body\":null,\"header\":null,\"extraData\":{\"activedMetricGroups\":[\"other\",\"other@issue_metrics_statistics\"],\"activedMetrics\":[{\"aggregation\":\"sum\",\"key\":\"645\",\"metric\":\"issue_metrics_statistics-not_close\"},{\"aggregation\":\"sum\",\"key\":\"635\",\"metric\":\"issue_metrics_statistics-counts\"}],\"filters\":[{\"key\":\"667\",\"method\":\"eq\",\"tag\":\"tags.issue_type\",\"value\":\"BUG\"}],\"group\":[\"tags.issue_user_nick\"]}},\"controls\":[{\"key\":\"eq_tags.issue_severity\",\"options\":[{\"name\":\"suggest\",\"value\":\"SUGGEST\"},{\"name\":\"slight\",\"value\":\"SLIGHT\"},{\"name\":\"serious\",\"value\":\"SERIOUS\"},{\"name\":\"fatal\",\"value\":\"FATAL\"},{\"name\":\"normal\",\"value\":\"NORMAL\"}],\"type\":\"select\"}]}}]', '[]', '');

2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ require (
github.com/buger/jsonparser v1.1.1
github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee
github.com/caarlos0/env v0.0.0-20180521112546-3e0f30cbf50b
github.com/cespare/xxhash v1.1.0
github.com/confluentinc/confluent-kafka-go v1.5.2
github.com/containerd/console v1.0.2
github.com/coreos/etcd v3.3.25+incompatible
Expand Down Expand Up @@ -152,6 +153,7 @@ require (
kmodules.xyz/monitoring-agent-api v0.0.0-20200125202117-d3b3e33ce41f
kmodules.xyz/objectstore-api v0.0.0-20200214040336-fe8f39a4210d
kmodules.xyz/offshoot-api v0.0.0-20200216080509-45ee6418d1c1
modernc.org/mathutil v1.0.0
moul.io/http2curl v1.0.0 // indirect
rsc.io/letsencrypt v0.0.3 // indirect
sigs.k8s.io/controller-runtime v0.9.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ github.com/Microsoft/hcsshim v0.8.14 h1:lbPVK25c1cu5xTLITwpUcxoA9vKrKErASPYygvou
github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
Expand Down Expand Up @@ -2397,6 +2398,7 @@ kmodules.xyz/offshoot-api v0.0.0-20200216080509-45ee6418d1c1 h1:4ZXeBIppt2MlDPrF
kmodules.xyz/offshoot-api v0.0.0-20200216080509-45ee6418d1c1/go.mod h1:k1M+OOFHbMeS6N6OB2j9smKfMCyQOEQjZ3SLZ/KSe+w=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0 h1:93vKjrJopTPrtTNpZ8XIovER7iCIH1QU7wNbOQXC60I=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
Expand Down
48 changes: 48 additions & 0 deletions modules/cmp/cache/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
CmpCache
------------

cache implement lru limited by memory usage. keys in CmpCache sorted by timestamp and lazy remove.

- [`entry`](#entry)
store value of cache data as Value type. data only support `Int` | `String` | `Float` | `Bool` | `UnsignedValue`

- `pair`
contains key , value ,overdue timestamp

- `segment`
cache contains 256 segments.
key hash to uint64 and assigned to specific segment

- `store`
contains segments , locks of each segment ,and a temporary slice for hash


- benchmark.


| method-duration | ns/op |
| ------------ | ---- |
| BenchmarkLRU_Rand | 306 |
| BenchmarkLRU_Freq | 278 |
| BenchmarkLRU_FreqParallel-8 | 148 |


- Interface

- ``Remove(key string) error``

- ``WriteMulti(pairs map[string]Values) error``

- ``Write(key string, value Values,overdueTimeStamp int64) error``

Add key value pair in cache.
- ``IncreaseSize(size int64)``

Increase capacity of memory thar cache could use
- ``DecrementSize(size int64) error``

Decrease capacity of memory thar cache could use
- ``Get(key string) (Values,bool, error)``

Return value that cache stored . The second return value is key expired or not.

Loading

0 comments on commit c7c8541

Please sign in to comment.