Skip to content
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

[TA4346] feat: Adding some more stats using OpenSeaChest library. #185

Merged
merged 3 commits into from Dec 7, 2018

Conversation

Projects
None yet
6 participants
@satbirchhikara
Copy link
Collaborator

satbirchhikara commented Dec 6, 2018

This PR is to add more information in Disk-CR using newly integrated OpenSeaChest library.
Red colored fields are newly added:-

satbir@node-disk-manager:$ kubectl describe disk disk-2cd7034c2b3329392ae07eb83bd15fad
Name:         disk-2cd7034c2b3329392ae07eb83bd15fad
Namespace:    
Labels:       kubernetes.io/hostname=gke-satbir-ndm-default-pool-32f04232-28rl
              ndm.io/disk-type=disk
Annotations:  <none>
API Version:  openebs.io/v1alpha1
Kind:         Disk
Metadata:
  Cluster Name:        
  Creation Timestamp:  2018-11-27T09:46:34Z
  Generation:          1
  Resource Version:    841260
  Self Link:           /apis/openebs.io/v1alpha1/disks/disk-2cd7034c2b3329392ae07eb83bd15fad
  UID:                 53b9c334-f229-11e8-b598-42010a8000c4
Spec:
  Capacity:
    Physical Sector Size:  4096   <<<Newly added
    Logical Sector Size:   512
    Storage:               10737418240
  Details:
    Disk Type:          disk
    Rotation Rate:      0             <<<Newly added
    Compliance:         SPC-4
    Firmware Revision:  1   
    Model:              PersistentDisk
    Serial:             satbir-ndm-disk-2
    Vendor:             Google
  Devlinks:
    Kind:  by-id
    Links:
      /dev/disk/by-id/scsi-0Google_PersistentDisk_satbir-ndm-disk-2
      /dev/disk/by-id/google-satbir-ndm-disk-2
    Kind:  by-path
    Links:
      /dev/disk/by-path/virtio-pci-0000:00:03.0-scsi-0:0:3:0
  Path:  /dev/sdc
Stats:  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Newly added
  Device Utilization Rate:  0
  Disk Temperature:
    Current Temperature:   0
    Highest Temperature:   0
    Lowest Temperature:    0
  Percent Endurance Used:  0
  Total Bytes Read:        0
  Total Bytes Written:     0
Status:
  State:  Active
Events:   <none> 

@satbirchhikara satbirchhikara requested review from kmova, gila, sagarkrsd and imazik Dec 6, 2018

@gila
Copy link
Member

gila left a comment

I feel you deserve a Gopher for your first Go bits @satbirchhikara 👍

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Dec 6, 2018

Codecov Report

Merging #185 into master will decrease coverage by 3.15%.
The diff coverage is 9.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #185      +/-   ##
==========================================
- Coverage   54.31%   51.16%   -3.16%     
==========================================
  Files          42       43       +1     
  Lines        1598     1720     +122     
==========================================
+ Hits          868      880      +12     
- Misses        668      777     +109     
- Partials       62       63       +1
Impacted Files Coverage Δ
cmd/probe/smartprobe.go 37.83% <ø> (ø) ⬆️
cmd/probe/probe.go 100% <ø> (ø) ⬆️
cmd/controller/sparsefilegenerator.go 65.85% <ø> (ø) ⬆️
cmd/probe/capacityprobe.go 20.45% <ø> (ø) ⬆️
cmd/probe/seachestprobe.go 0% <0%> (ø)
cmd/probe/udevprobe.go 62.38% <100%> (+0.34%) ⬆️
cmd/controller/disk.go 94.8% <73.33%> (-5.2%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bbd9f6...36ea480. Read the comment docs.

return 0
}

func (I *Identifier) IsRotational(driveInfo *C.driveInformationSAS_SATA) string {

This comment has been minimized.

Copy link
@richardelling

richardelling Dec 6, 2018

Collaborator

you're getting closer, I think this should return a boolean. Given the way we often see this in the field, I think we can safely say:

if driveInfo.rotationRate > 1 {
  return True
}
return false

This comment has been minimized.

Copy link
@satbirchhikara

satbirchhikara Dec 7, 2018

Author Collaborator

Since we are filling drive type "SSD" or "HDD", I renamed function to driveType. This is something inline with OpenSeaChest Utility. They classify deive exactly the way we are doing here.

@@ -34,7 +34,7 @@ type smartProbe struct {

const (
smartConfigKey = "smart-probe"
smartProbePriority = 2
smartProbePriority = 3

This comment has been minimized.

Copy link
@vishnuitta

vishnuitta Dec 7, 2018

Member

should we have similar change for udevProbePriority as well from 1 to 2?

This comment has been minimized.

Copy link
@vishnuitta

vishnuitta Dec 7, 2018

Member

ok.. seaChestProbePriority is set to 2.. so, udevProbePriority should be fine then

satbirchhikara added some commits Dec 7, 2018

Fixing autogen update script.
Signed-off-by: satbir <satbir.singh@mayadata.io>
Autogen code for SeaChest integration.
Signed-off-by: satbir <satbir.singh@mayadata.io>
[TA4157]Integration of SeaChest library.
Signed-off-by: satbir <satbir.singh@mayadata.io>

@satbirchhikara satbirchhikara force-pushed the satbirchhikara:morestats branch from 5c87687 to 36ea480 Dec 7, 2018

@@ -1,3 +1,4 @@
dist: xenial
language: go

This comment has been minimized.

Copy link
@pawanpraka1

pawanpraka1 Dec 7, 2018

Contributor

we should probably compile it in a docker. We need dapper for ndm probably in future PR.

@@ -28,6 +28,7 @@ const (

// RegisteredProbes contains register function of probes which we want to register
var RegisteredProbes = []func(){

This comment has been minimized.

Copy link
@pawanpraka1

pawanpraka1 Dec 7, 2018

Contributor

for better code readability please reorder this list in the priority order (next PR).

@pawanpraka1
Copy link
Contributor

pawanpraka1 left a comment

changes are good.

@pawanpraka1 pawanpraka1 merged commit d0bbab3 into openebs:master Dec 7, 2018

3 of 5 checks passed

codecov/patch 9.83% of diff hit (target 54.31%)
Details
codecov/project 51.16% (-3.16%) compared to 3bbd9f6
Details
Better Code Hub ☕ Don’t forget to refactor
Details
DCO All commits are signed off!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@satbirchhikara satbirchhikara deleted the satbirchhikara:morestats branch Dec 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.