Applying proper formatting

This commit is contained in:
Jesse Hanley 2016-04-27 15:30:00 -04:00
parent c8626b6455
commit abe9e15052
2 changed files with 64 additions and 64 deletions

View File

@ -168,52 +168,52 @@ var wanted_ost_jobstats_fields = []*mapping{
reportAs: "jobstats_write_bytes", reportAs: "jobstats_write_bytes",
}, },
{ {
inProc: "getattr", inProc: "getattr",
field: 3, field: 3,
reportAs: "jobstats_ost_getattr", reportAs: "jobstats_ost_getattr",
}, },
{ {
inProc: "setattr", inProc: "setattr",
field: 3, field: 3,
reportAs: "jobstats_ost_setattr", reportAs: "jobstats_ost_setattr",
}, },
{ {
inProc: "punch", inProc: "punch",
field: 3, field: 3,
reportAs: "jobstats_punch", reportAs: "jobstats_punch",
}, },
{ {
inProc: "sync", inProc: "sync",
field: 3, field: 3,
reportAs: "jobstats_ost_sync", reportAs: "jobstats_ost_sync",
}, },
{ {
inProc: "destroy", inProc: "destroy",
field: 3, field: 3,
reportAs: "jobstats_destroy", reportAs: "jobstats_destroy",
}, },
{ {
inProc: "create", inProc: "create",
field: 3, field: 3,
reportAs: "jobstats_create", reportAs: "jobstats_create",
}, },
{ {
inProc: "statfs", inProc: "statfs",
field: 3, field: 3,
reportAs: "jobstats_ost_statfs", reportAs: "jobstats_ost_statfs",
}, },
{ {
inProc: "get_info", inProc: "get_info",
field: 3, field: 3,
reportAs: "jobstats_get_info", reportAs: "jobstats_get_info",
}, },
{ {
inProc: "set_info", inProc: "set_info",
field: 3, field: 3,
reportAs: "jobstats_set_info", reportAs: "jobstats_set_info",
}, },
{ {
inProc: "quotactl", inProc: "quotactl",
field: 3, field: 3,
reportAs: "jobstats_quotactl", reportAs: "jobstats_quotactl",
}, },
@ -272,82 +272,82 @@ var wanted_mds_fields = []*mapping{
var wanted_mdt_jobstats_fields = []*mapping{ var wanted_mdt_jobstats_fields = []*mapping{
{ {
inProc: "open", inProc: "open",
field: 3, field: 3,
reportAs: "jobstats_open", reportAs: "jobstats_open",
}, },
{ {
inProc: "close", inProc: "close",
field: 3, field: 3,
reportAs: "jobstats_close", reportAs: "jobstats_close",
}, },
{ {
inProc: "mknod", inProc: "mknod",
field: 3, field: 3,
reportAs: "jobstats_mknod", reportAs: "jobstats_mknod",
}, },
{ {
inProc: "link", inProc: "link",
field: 3, field: 3,
reportAs: "jobstats_link", reportAs: "jobstats_link",
}, },
{ {
inProc: "unlink", inProc: "unlink",
field: 3, field: 3,
reportAs: "jobstats_unlink", reportAs: "jobstats_unlink",
}, },
{ {
inProc: "mkdir", inProc: "mkdir",
field: 3, field: 3,
reportAs: "jobstats_mkdir", reportAs: "jobstats_mkdir",
}, },
{ {
inProc: "rmdir", inProc: "rmdir",
field: 3, field: 3,
reportAs: "jobstats_rmdir", reportAs: "jobstats_rmdir",
}, },
{ {
inProc: "rename", inProc: "rename",
field: 3, field: 3,
reportAs: "jobstats_rename", reportAs: "jobstats_rename",
}, },
{ {
inProc: "getattr", inProc: "getattr",
field: 3, field: 3,
reportAs: "jobstats_getattr", reportAs: "jobstats_getattr",
}, },
{ {
inProc: "setattr", inProc: "setattr",
field: 3, field: 3,
reportAs: "jobstats_setattr", reportAs: "jobstats_setattr",
}, },
{ {
inProc: "getxattr", inProc: "getxattr",
field: 3, field: 3,
reportAs: "jobstats_getxattr", reportAs: "jobstats_getxattr",
}, },
{ {
inProc: "setxattr", inProc: "setxattr",
field: 3, field: 3,
reportAs: "jobstats_setxattr", reportAs: "jobstats_setxattr",
}, },
{ {
inProc: "statfs", inProc: "statfs",
field: 3, field: 3,
reportAs: "jobstats_statfs", reportAs: "jobstats_statfs",
}, },
{ {
inProc: "sync", inProc: "sync",
field: 3, field: 3,
reportAs: "jobstats_sync", reportAs: "jobstats_sync",
}, },
{ {
inProc: "samedir_rename", inProc: "samedir_rename",
field: 3, field: 3,
reportAs: "jobstats_samedir_rename", reportAs: "jobstats_samedir_rename",
}, },
{ {
inProc: "crossdir_rename", inProc: "crossdir_rename",
field: 3, field: 3,
reportAs: "jobstats_crossdir_rename", reportAs: "jobstats_crossdir_rename",
}, },
@ -388,7 +388,7 @@ func (l *Lustre2) GetLustreProcStats(fileglob string, wanted_fields []*mapping,
for _, wanted := range wanted_fields { for _, wanted := range wanted_fields {
var data uint64 var data uint64
if strings.TrimSuffix(parts[0],":") == wanted.inProc { if strings.TrimSuffix(parts[0], ":") == wanted.inProc {
wanted_field := wanted.field wanted_field := wanted.field
// if not set, assume field[1]. Shouldn't be field[0], as // if not set, assume field[1]. Shouldn't be field[0], as
// that's a string // that's a string

View File

@ -160,7 +160,7 @@ func TestLustre2GeneratesMetrics(t *testing.T) {
"unlink": uint64(3549417), "unlink": uint64(3549417),
"write_bytes": uint64(15201500833981), "write_bytes": uint64(15201500833981),
"write_calls": uint64(71893382), "write_calls": uint64(71893382),
} }
acc.AssertContainsTaggedFields(t, "lustre2", fields, tags) acc.AssertContainsTaggedFields(t, "lustre2", fields, tags)
@ -200,46 +200,46 @@ func TestLustre2GeneratesJobstatsMetrics(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
tags := map[string]string{ tags := map[string]string{
"name": ost_name, "name": ost_name,
"jobid": job_name, "jobid": job_name,
} }
fields := map[string]interface{}{ fields := map[string]interface{}{
"jobstats_read_calls": uint64(1), "jobstats_read_calls": uint64(1),
"jobstats_read_min_size": uint64(4096), "jobstats_read_min_size": uint64(4096),
"jobstats_read_max_size": uint64(4096), "jobstats_read_max_size": uint64(4096),
"jobstats_read_bytes": uint64(4096), "jobstats_read_bytes": uint64(4096),
"jobstats_write_calls": uint64(25), "jobstats_write_calls": uint64(25),
"jobstats_write_min_size": uint64(1048576), "jobstats_write_min_size": uint64(1048576),
"jobstats_write_max_size": uint64(1048576), "jobstats_write_max_size": uint64(1048576),
"jobstats_write_bytes": uint64(26214400), "jobstats_write_bytes": uint64(26214400),
"jobstats_ost_getattr": uint64(0), "jobstats_ost_getattr": uint64(0),
"jobstats_ost_setattr": uint64(0), "jobstats_ost_setattr": uint64(0),
"jobstats_punch": uint64(1), "jobstats_punch": uint64(1),
"jobstats_ost_sync": uint64(0), "jobstats_ost_sync": uint64(0),
"jobstats_destroy": uint64(0), "jobstats_destroy": uint64(0),
"jobstats_create": uint64(0), "jobstats_create": uint64(0),
"jobstats_ost_statfs": uint64(0), "jobstats_ost_statfs": uint64(0),
"jobstats_get_info": uint64(0), "jobstats_get_info": uint64(0),
"jobstats_set_info": uint64(0), "jobstats_set_info": uint64(0),
"jobstats_quotactl": uint64(0), "jobstats_quotactl": uint64(0),
"jobstats_open": uint64(5), "jobstats_open": uint64(5),
"jobstats_close": uint64(4), "jobstats_close": uint64(4),
"jobstats_mknod": uint64(6), "jobstats_mknod": uint64(6),
"jobstats_link": uint64(8), "jobstats_link": uint64(8),
"jobstats_unlink": uint64(90), "jobstats_unlink": uint64(90),
"jobstats_mkdir": uint64(521), "jobstats_mkdir": uint64(521),
"jobstats_rmdir": uint64(520), "jobstats_rmdir": uint64(520),
"jobstats_rename": uint64(9), "jobstats_rename": uint64(9),
"jobstats_getattr": uint64(11), "jobstats_getattr": uint64(11),
"jobstats_setattr": uint64(1), "jobstats_setattr": uint64(1),
"jobstats_getxattr": uint64(3), "jobstats_getxattr": uint64(3),
"jobstats_setxattr": uint64(4), "jobstats_setxattr": uint64(4),
"jobstats_statfs": uint64(1205), "jobstats_statfs": uint64(1205),
"jobstats_sync": uint64(2), "jobstats_sync": uint64(2),
"jobstats_samedir_rename": uint64(705), "jobstats_samedir_rename": uint64(705),
"jobstats_crossdir_rename": uint64(200), "jobstats_crossdir_rename": uint64(200),
} }
acc.AssertContainsTaggedFields(t, "lustre2", fields, tags) acc.AssertContainsTaggedFields(t, "lustre2", fields, tags)