Skip to content

Commit

Permalink
Release v2020.10.21.1 (#774)
Browse files Browse the repository at this point in the history
* ui: display error message instead of stack trace on connect failure (#769)
* keyviz: fix panic in matrix (#773)
  • Loading branch information
HunDunDM authored Oct 22, 2020
1 parent 6eefcba commit 94d8dc3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/keyvisual/matrix/axis.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (c *chunk) Reduce(newKeys []string) chunk {
endKeys := newKeys[1:]
j := 0
for i, value := range c.Values {
if equal(keys[i], endKeys[j]) {
if i > 0 && equal(keys[i], endKeys[j]) {
j++
}
newValues[j] += value
Expand Down
28 changes: 28 additions & 0 deletions pkg/keyvisual/matrix/axis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,31 @@ import (
var _ = Suite(&testAxisSuite{})

type testAxisSuite struct{}

func (s *testAxisSuite) TestChunkReduce(c *C) {
testcases := []struct {
keys []string
values []uint64
newKeys []string
newValues []uint64
}{
{
[]string{"", "a", "b", "c", ""},
[]uint64{1, 10, 100, 1000},
[]string{"", "b", ""},
[]uint64{11, 1100},
},
{
[]string{"", "a", "b", "c", ""},
[]uint64{1, 10, 100, 1000},
[]string{"", ""},
[]uint64{1111},
},
}

for _, testcase := range testcases {
originChunk := createChunk(testcase.keys, testcase.values)
reduceChunk := originChunk.Reduce(testcase.newKeys)
c.Assert(reduceChunk.Values, DeepEquals, testcase.newValues)
}
}
2 changes: 1 addition & 1 deletion release-version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file specifies the TiDB Dashboard internal version, which will be printed in `--version`
# and UI. In release branch, changing this file will result in publishing a new version and tag.
2020.09.21.1
2020.10.21.1
2 changes: 1 addition & 1 deletion ui/dashboardApp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function main() {
} catch (e) {
Modal.error({
title: 'Failed to connect to TiDB Dashboard server',
content: e.stack,
content: '' + e,
okText: 'Reload',
onOk: () => window.location.reload(),
})
Expand Down

0 comments on commit 94d8dc3

Please sign in to comment.