Add power draw field to nvidia_smi plugin (#4262)

This commit is contained in:
marcv81
2018-06-12 07:06:26 +08:00
committed by Daniel Nelson
parent 33fdc2ef29
commit 397a9b3fce
3 changed files with 29 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ import (
)
func TestParseLineStandard(t *testing.T) {
line := "85, 8114, 553, 7561, P2, 61, GeForce GTX 1070 Ti, GPU-d1911b8a-f5c8-5e66-057c-486561269de8, Default, 100, 93, 1\n"
line := "85, 8114, 553, 7561, P2, 61, GeForce GTX 1070 Ti, GPU-d1911b8a-f5c8-5e66-057c-486561269de8, Default, 100, 93, 1, 0.0\n"
tags, fields, err := parseLine(line)
if err != nil {
t.Fail()
@@ -37,7 +37,7 @@ func TestParseLineBad(t *testing.T) {
}
func TestParseLineNotSupported(t *testing.T) {
line := "[Not Supported], 7606, 0, 7606, P0, 38, Tesla P4, GPU-xxx, Default, 0, 0, 0\n"
line := "[Not Supported], 7606, 0, 7606, P0, 38, Tesla P4, GPU-xxx, Default, 0, 0, 0, 0.0\n"
_, fields, err := parseLine(line)
require.NoError(t, err)
require.Equal(t, nil, fields["fan_speed"])