[Why] In compare results: the value of *timestamp*(metric) doesn't mean the number of occurrences, it may confuse user like bellow:
openeuler centos archLinux metric -------------------- ------------------------------ ------------------------------ ------------------------------ fails:runs change fails:runs change fails:runs | | | | | 3585:13 +6913.7% 344:1 -2.6e+4% 11:1 dmesg.timestamp:last 2350:13 +1.6e+4% 344:1 -1.7e+4% 10:1 kmsg.timestamp:last 2:13 -15.4% 0:1 +84.6% 1:1 last_state.exit_fail
[How] remove the metric that include "timestamp" from matrix
Signed-off-by: Lu Weitao luweitaobe@163.com --- lib/matrix2.rb | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/lib/matrix2.rb b/lib/matrix2.rb index c712e32..2769f7c 100644 --- a/lib/matrix2.rb +++ b/lib/matrix2.rb @@ -87,6 +87,8 @@ def create_matrix(job_list) next unless stats
stats.each do |key, value| + next if key.include?('timestamp') + matrix[key] = [] unless matrix[key] matrix[key] << value end
@@ -87,6 +87,8 @@ def create_matrix(job_list) next unless stats
stats.each do |key, value|
next if key.include?('timestamp')
mostly we use include for a hash include a key, or array include a element. that would be fine use include here, but I think use match? better
Thanks, Luan Shengde
endmatrix[key] = [] unless matrix[key] matrix[key] << value
-- 2.23.0
On Tue, Dec 22, 2020 at 09:34:27AM +0800, Luan Shengde wrote:
@@ -87,6 +87,8 @@ def create_matrix(job_list) next unless stats
stats.each do |key, value|
next if key.include?('timestamp')
mostly we use include for a hash include a key, or array include a element. that would be fine use include here, but I think use match? better
A String object holds and manipulates an arbitrary sequence of bytes, typically representing characters.
Thanks, RenWen
Thanks, Luan Shengde
endmatrix[key] = [] unless matrix[key] matrix[key] << value
-- 2.23.0
On Tue, Dec 22, 2020 at 10:28:03AM +0800, Ren Wen wrote:
On Tue, Dec 22, 2020 at 09:34:27AM +0800, Luan Shengde wrote:
@@ -87,6 +87,8 @@ def create_matrix(job_list) next unless stats
stats.each do |key, value|
next if key.include?('timestamp')
mostly we use include for a hash include a key, or array include a element. that would be fine use include here, but I think use match? better
A String object holds and manipulates an arbitrary sequence of bytes, typically representing characters.
seems a string menas [] of char in ruby. we can operate a sting like array.
Thanks, Weitao
Thanks, RenWen
Thanks, Luan Shengde
endmatrix[key] = [] unless matrix[key] matrix[key] << value
-- 2.23.0