diff --git a/gateway/assets/index.html b/gateway/assets/index.html
index 4a994bceff..79930748a2 100644
--- a/gateway/assets/index.html
+++ b/gateway/assets/index.html
@@ -124,7 +124,7 @@
-
+
diff --git a/gateway/assets/script/bootstrap.js b/gateway/assets/script/bootstrap.js
index 68c8c657a3..7e6050a561 100644
--- a/gateway/assets/script/bootstrap.js
+++ b/gateway/assets/script/bootstrap.js
@@ -222,6 +222,16 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$interval', '$f
$scope.selectedFunction = undefined;
}
}
+
+ if ($scope.selectedFunction) {
+ response.data.some(function(entry) {
+ if (entry.name === $scope.selectedFunction.name) {
+ $scope.selectedFunction.invocationCount = entry.invocationCount
+ return true
+ }
+ });
+ }
+
});
};
diff --git a/gateway/metrics/add_metrics.go b/gateway/metrics/add_metrics.go
index 2171db2394..efeabdfa7f 100644
--- a/gateway/metrics/add_metrics.go
+++ b/gateway/metrics/add_metrics.go
@@ -76,6 +76,7 @@ func AddMetricsHandler(handler http.HandlerFunc, prometheusQuery PrometheusQuery
}
func mixIn(functions *[]types.FunctionStatus, metrics *VectorQueryResponse) {
+
if functions == nil {
return
}
@@ -88,11 +89,10 @@ func mixIn(functions *[]types.FunctionStatus, metrics *VectorQueryResponse) {
for i, function := range *functions {
for _, v := range metrics.Data.Result {
- if v.Metric.FunctionName == fmt.Sprintf("%s.%s", function.Name, function.Namespace) {
+ if v.Metric.FunctionName == function.Name || v.Metric.FunctionName == fmt.Sprintf("%s.%s", function.Name, function.Namespace) {
metricValue := v.Value[1]
switch metricValue.(type) {
case string:
- // log.Println("String")
f, strconvErr := strconv.ParseFloat(metricValue.(string), 64)
if strconvErr != nil {
log.Printf("Unable to convert value for metric: %s\n", strconvErr)