-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metrics extended #9
metrics extended #9
Conversation
OpenedAt string `json:"opened_at"` | ||
ShareMode SMBStatusOpenShareMode `json:"sharemode"` | ||
AccessMask SMBStatusOpenAccessMask `json:"access_mask"` | ||
OpLock SMBStatusOpenOpLock `json:"oplock"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a plan to include leases
section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, absolutely. It is part of my TODO
list, but for now I want a minimal viable set of metrics. Do you think leases
should be part of it or may I defer it to next cycle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leases
can be considered as an upgrade to oplocks
. I could see oplocks
(but not yet used) and thus the question. You may choose to drop oplocks
or add leases
alongside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I will add lease
s as part of this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anoopcs9 Added Lease
entry (after OpLock
). Please re-review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below for a small query.
175e47e
to
02f8329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks.
internal/metrics/smbstatus_test.go
Outdated
@@ -602,3 +616,16 @@ func TestParseSMBStatusLocks(t *testing.T) { | |||
assert.Equal(t, lock2.FileID.Inode, int64(52)) | |||
assert.Equal(t, lock2.NumPendingDeletes, 2) | |||
} | |||
|
|||
func TestParseSMBStatusLease(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be add a test for oplocks
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right -- I should have done so in the first place..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
02f8329
to
cb7f8b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below for a small nit.
internal/metrics/smbstatus_test.go
Outdated
assert.Equal(t, lease.Handle, false) | ||
assert.Equal(t, lease.Read, false) | ||
assert.Equal(t, lease.Write, false) | ||
assert.Equal(t, lease.Text, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To cover other SMBStatusOpenOpLock
types:
assert.Equal(t, oplock.Batch, true)
assert.Equal(t, oplock.LevelII, false)
assert.Equal(t, oplock.Text, "BATCH")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you meant to include the additional checks in the current PR itself I don't see it in the updated version.
cb7f8b5
to
5c65869
Compare
5c65869
to
53ad326
Compare
Add extra layer of JSON parsing for more file-grained details on currently open-files. In particular, parse access-modes. Signed-off-by: Shachar Sharon <[email protected]>
Provides two new metrics: number of total open-file in RO/RW modes. Uses the detailed SMB information provided by 'open_files' section per file. Signed-off-by: Shachar Sharon <[email protected]>
Define two distinct share counter-metrics: number of remote machines currently using a specific share and the number of distinct shares used by a specific remote machine (identified by IP-address). Signed-off-by: Shachar Sharon <[email protected]>
Ignore the special value of "IPC$" when collecting and exporting shares' metrics. Signed-off-by: Shachar Sharon <[email protected]>
53ad326
to
4421fd1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks
Provide extra-fine metrics information. In particular,. parse the
open_files
section insmbstatus --json
and provide more metrics on open files.