From 93aec6a99fdb586970f4381f5510ae100ba875e4 Mon Sep 17 00:00:00 2001 From: Tovin Seven Date: Thu, 19 Jan 2017 16:44:47 +0700 Subject: [PATCH] Fix mistake in split meta string When trace meta include more than one dot "." such as: meta.raw_payload.Stack.state_set-start OSprofiler will display Stack section only. Change-Id: I53de736f9fbc3fd1fcd14aa975efdf8a60c6d126 Closes-Bug: #1657684 --- osprofiler/cmd/template.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osprofiler/cmd/template.html b/osprofiler/cmd/template.html index d2d54ca..502778e 100644 --- a/osprofiler/cmd/template.html +++ b/osprofiler/cmd/template.html @@ -152,7 +152,8 @@ var metadata = {}; angular.forEach(info, function(value, key) { var parts = key.split('.'); - if (parts[0] == 'meta') { + var metaText = 'meta'; + if (parts[0] == metaText) { if (parts.length == 2) { this[parts[1]] = value; } else { @@ -160,8 +161,9 @@ if (!(groupName in this)) { this[groupName] = {}; } - - this[groupName][parts[2]] = value; + // Plus 2 for 2 dots such as: meta.raw_payload.heat.wsgi-start + var index = metaText.length + parts[1].length + 2; + this[groupName][key.slice(index)] = value; } }; }, metadata);