@@ -17,17 +17,14 @@ limitations under the License.
17
17
package cmd
18
18
19
19
import (
20
- "fmt"
21
20
"strings"
22
21
"time"
23
22
24
23
"github.com/cortexlabs/cortex/cli/types/cliconfig"
25
24
"github.com/cortexlabs/cortex/pkg/lib/console"
26
- s "github.com/cortexlabs/cortex/pkg/lib/strings"
27
25
"github.com/cortexlabs/cortex/pkg/lib/table"
28
26
libtime "github.com/cortexlabs/cortex/pkg/lib/time"
29
27
"github.com/cortexlabs/cortex/pkg/operator/schema"
30
- "github.com/cortexlabs/cortex/pkg/types/metrics"
31
28
)
32
29
33
30
func realtimeAPITable (realtimeAPI schema.APIResponse , env cliconfig.Environment ) (string , error ) {
@@ -61,8 +58,6 @@ func realtimeAPIsTable(realtimeAPIs []schema.APIResponse, envNames []string) tab
61
58
62
59
var totalFailed int32
63
60
var totalStale int32
64
- var total4XX int
65
- var total5XX int
66
61
67
62
for i , realtimeAPI := range realtimeAPIs {
68
63
lastUpdated := time .Unix (realtimeAPI .Spec .LastUpdated , 0 )
@@ -75,19 +70,10 @@ func realtimeAPIsTable(realtimeAPIs []schema.APIResponse, envNames []string) tab
75
70
realtimeAPI .Status .Requested ,
76
71
realtimeAPI .Status .Updated .TotalFailed (),
77
72
libtime .SinceStr (& lastUpdated ),
78
- latencyStr (realtimeAPI .Metrics ),
79
- code2XXStr (realtimeAPI .Metrics ),
80
- code4XXStr (realtimeAPI .Metrics ),
81
- code5XXStr (realtimeAPI .Metrics ),
82
73
})
83
74
84
75
totalFailed += realtimeAPI .Status .Updated .TotalFailed ()
85
76
totalStale += realtimeAPI .Status .Stale .Ready
86
-
87
- if realtimeAPI .Metrics .NetworkStats != nil {
88
- total4XX += realtimeAPI .Metrics .NetworkStats .Code4XX
89
- total5XX += realtimeAPI .Metrics .NetworkStats .Code5XX
90
- }
91
77
}
92
78
93
79
return table.Table {
@@ -100,42 +86,7 @@ func realtimeAPIsTable(realtimeAPIs []schema.APIResponse, envNames []string) tab
100
86
{Title : _titleRequested },
101
87
{Title : _titleFailed , Hidden : totalFailed == 0 },
102
88
{Title : _titleLastupdated },
103
- {Title : _titleAvgRequest },
104
- {Title : _title2XX },
105
- {Title : _title4XX , Hidden : total4XX == 0 },
106
- {Title : _title5XX , Hidden : total5XX == 0 },
107
89
},
108
90
Rows : rows ,
109
91
}
110
92
}
111
-
112
- func latencyStr (metrics * metrics.Metrics ) string {
113
- if metrics .NetworkStats == nil || metrics .NetworkStats .Latency == nil {
114
- return "-"
115
- }
116
- if * metrics .NetworkStats .Latency < 1000 {
117
- return fmt .Sprintf ("%.6g ms" , * metrics .NetworkStats .Latency )
118
- }
119
- return fmt .Sprintf ("%.6g s" , (* metrics .NetworkStats .Latency )/ 1000 )
120
- }
121
-
122
- func code2XXStr (metrics * metrics.Metrics ) string {
123
- if metrics .NetworkStats == nil || metrics .NetworkStats .Code2XX == 0 {
124
- return "-"
125
- }
126
- return s .Int (metrics .NetworkStats .Code2XX )
127
- }
128
-
129
- func code4XXStr (metrics * metrics.Metrics ) string {
130
- if metrics .NetworkStats == nil || metrics .NetworkStats .Code4XX == 0 {
131
- return "-"
132
- }
133
- return s .Int (metrics .NetworkStats .Code4XX )
134
- }
135
-
136
- func code5XXStr (metrics * metrics.Metrics ) string {
137
- if metrics .NetworkStats == nil || metrics .NetworkStats .Code5XX == 0 {
138
- return "-"
139
- }
140
- return s .Int (metrics .NetworkStats .Code5XX )
141
- }
0 commit comments