Skip to content

Conversation

@ninzavivek
Copy link
Contributor

Exposed a new API to get number of CPU Cores on a Node. This will be used by DNC eventually to enforce per node NIC limit which is dependent on number of cores.

DNC before allocating a NIC, will get query a node for number of cores and see if the limit ha already been achieved,

@codecov
Copy link

codecov bot commented Jul 23, 2019

Codecov Report

Merging #379 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #379   +/-   ##
=======================================
  Coverage   40.01%   40.01%           
=======================================
  Files          25       25           
  Lines        3546     3546           
=======================================
  Hits         1419     1419           
  Misses       1927     1927           
  Partials      200      200

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 22f945d...917905b. Read the comment docs.

cns/api.go Outdated
}

// getNumberOfCPUCores describes reponse that returns the host local IP Address.
// getNumberOfCPUCores describes reponse that returns num of cpu cores present on host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the comment say - NumOfCPUCoresResponse describes ... ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this should be NumOfCPUCoresResponse

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you resolve this?

log.Printf("[Azure-CNS] getNumberOfCPUCores")
log.Request(service.Name, "getNumberOfCPUCores", nil)

var num int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you combine the vars together ?
var (
num int
returnCode int
errMsg string
)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-). Is this being done anywhere in similar context?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree its not done elsewhere but whatever ashvin suggested looks better. lets do this from now on

cns/api.go Outdated
}

// getNumberOfCPUCores describes reponse that returns the host local IP Address.
// getNumberOfCPUCores describes reponse that returns num of cpu cores present on host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this should be NumOfCPUCoresResponse

cns/api.go Outdated
}

// getNumberOfCPUCores describes reponse that returns the host local IP Address.
// getNumberOfCPUCores describes reponse that returns num of cpu cores present on host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you resolve this?

log.Printf("[Azure-CNS] getNumberOfCPUCores")
log.Request(service.Name, "getNumberOfCPUCores", nil)

var num int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree its not done elsewhere but whatever ashvin suggested looks better. lets do this from now on

@ninzavivek ninzavivek merged commit 2c7dc77 into Azure:master Jul 23, 2019
@ninzavivek ninzavivek deleted the nic_limit branch July 24, 2019 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants