зеркало из https://github.com/github/vitess-gh.git
vtgate: Fix that the tablet type is shown in the "Partitions:" list on the status page.
Before, string(i) was shown where i is the index of the array element (e.g. 0, 1 or 2). string(i) for these low i values always returned an empty string because it would be interpreted as an ASCII code and these low values do not map to printable characters. Other changes: - use upper case tablet type string in the ServedFrom output. This is consistent with the "Gateway Status" and "Health Check Cache" output. - Fixed output of the ShardingColumnType enum.
This commit is contained in:
Родитель
5919cdd56c
Коммит
be7cdde8fe
|
@ -13,11 +13,10 @@ import (
|
|||
"time"
|
||||
|
||||
log "github.com/golang/glog"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"github.com/youtube/vitess/go/stats"
|
||||
"github.com/youtube/vitess/go/vt/topo"
|
||||
"github.com/youtube/vitess/go/vt/topo/topoproto"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
topodatapb "github.com/youtube/vitess/go/vt/proto/topodata"
|
||||
)
|
||||
|
@ -350,8 +349,8 @@ func (st *SrvKeyspaceCacheStatus) StatusAsHTML() template.HTML {
|
|||
}
|
||||
|
||||
result := "<b>Partitions:</b><br>"
|
||||
for tabletType, keyspacePartition := range st.Value.Partitions {
|
||||
result += " <b>" + string(tabletType) + "</b>"
|
||||
for _, keyspacePartition := range st.Value.Partitions {
|
||||
result += " <b>" + keyspacePartition.ServedType.String() + ":</b>"
|
||||
for _, shard := range keyspacePartition.ShardReferences {
|
||||
result += " " + shard.Name
|
||||
}
|
||||
|
@ -360,13 +359,13 @@ func (st *SrvKeyspaceCacheStatus) StatusAsHTML() template.HTML {
|
|||
|
||||
if st.Value.ShardingColumnName != "" {
|
||||
result += "<b>ShardingColumnName:</b> " + st.Value.ShardingColumnName + "<br>"
|
||||
result += "<b>ShardingColumnType:</b> " + string(st.Value.ShardingColumnType) + "<br>"
|
||||
result += "<b>ShardingColumnType:</b> " + st.Value.ShardingColumnType.String() + "<br>"
|
||||
}
|
||||
|
||||
if len(st.Value.ServedFrom) > 0 {
|
||||
result += "<b>ServedFrom:</b><br>"
|
||||
for _, sf := range st.Value.ServedFrom {
|
||||
result += " <b>" + topoproto.TabletTypeLString(sf.TabletType) + "</b> " + sf.Keyspace + "<br>"
|
||||
result += " <b>" + sf.TabletType.String() + ":</b> " + sf.Keyspace + "<br>"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче