tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
572 stars 99 forks source link

Show overview broken out by interface capacities #548

Closed byxorna closed 7 years ago

byxorna commented 7 years ago

Fixes #545

@michaeljs1990 This updates the show overview to indicate how many of each capacity interface are present. For example, if a machine has 4x1g and 1x10g interfaces, the show overview will reflect this in a terse manner. Similarly, a machine with 1x40g nic will show that it includes a 40g nic, instead of reporting it does not have a 10g.

cc @defect @roymarantz @gtorre @qx-xp

Homogenous interfaces: screenshot from 2017-05-20 14-09-33

Mixed interfaces: screenshot from 2017-05-20 14-19-14

michaeljs1990 commented 7 years ago

I like this since it will also work with the strange 25GbE and 50GbE cards that could pop up in the DC.

Can we remove *GbNic functions all together instead of deprecating them? It looks like the only place they are used is in tests and show_overview.html which should be easy to switch over.

eatingthenight@lix:~/Code/collins$ grep -r hasGbNic .
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.hasGbNic must beTrue
./app/collins/util/LshwRepresentation.scala:  def hasGbNic: Boolean = nics.find { _.speed.inGigabits == 1 }.map { _ => true }.getOrElse(false)
./app/collins/util/LshwRepresentation.scala:        (hasGbNic == other.hasGbNic) &&

eatingthenight@lix:~/Code/collins$ grep -r has10GbNic .
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beTrue
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic aka "has 10 gig card" must beTrue // picked up from default in config
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./test/collins/util/parsers/LshwParserSpec.scala:          rep.has10GbNic must beFalse
./app/views/asset/show_overview.scala.html:          <td>@{if (aa.lshw.has10GbNic) "Yes" else "No"}</td>
./app/collins/util/LshwRepresentation.scala:  def has10GbNic: Boolean = nics.find { _.speed.inGigabits == 10 }.map { _ => true }.getOrElse(false)
./app/collins/util/LshwRepresentation.scala:        (has10GbNic == other.has10GbNic)
byxorna commented 7 years ago

@michaeljs1990 yea, i was going to but wanted to put up the most simple diff first. I am game to gut those unnecessary methods. Next push will include that.

byxorna commented 7 years ago

@michaeljs1990 removed unnecessary methods :)