Skip to content

Commit

Permalink
Merge pull request #3304 from telstra/perf/one_flow_four_paths
Browse files Browse the repository at this point in the history
Multiple updates to EnduranceV2Spec
  • Loading branch information
nikitamarchenko committed Mar 23, 2020
2 parents d141ffd + bb07037 commit 921d109
Show file tree
Hide file tree
Showing 8 changed files with 220 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
import groovy.transform.Memoized
import groovy.util.logging.Slf4j
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Value
import org.springframework.stereotype.Component

@Component
Expand All @@ -27,6 +28,9 @@ class TopologyHelper {
@Autowired
Database database

@Value('#{\'${floodlight.regions}\'.split(\',\')}')
private List<String> regions;

/**
* Get a switch pair of random switches.
*
Expand Down Expand Up @@ -94,7 +98,9 @@ class TopologyHelper {
def i = 0
def topoSwitches = switches.collect {
i++
new Switch("ofsw$i", it.switchId, it.ofVersion, switchStateToStatus(it.state), [], null, null)
//TODO(rtretiak): properly discover the switch's region instead of just picking first
new Switch("ofsw$i", it.switchId, it.ofVersion, switchStateToStatus(it.state), regions.first(), [],
null, null)
}
def topoLinks = links.collect { link ->
new Isl(topoSwitches.find { it.dpId == link.source.switchId }, link.source.portNo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ class Wrappers {
*/
static def benchmark(name, closure) {
def start = System.currentTimeMillis()
def result = closure.call()
def now = System.currentTimeMillis()
log.debug("$name took " + (now - start) + "ms")
return result
def result
try {
result = closure.call()
} finally {
def now = System.currentTimeMillis()
log.debug("$name took " + (now - start) + "ms")
return result
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ class SwitchesSpec extends HealthCheckSpecification {
getSwitchFlowsResponse6*.id.sort() == [protectedFlow.flowId, singleFlow.flowId, defaultFlow.flowId].sort()

cleanup: "Delete the flows"
doPortDowns && topology.getBusyPortsForSwitch(switchPair.src).each { antiflap.portUp(switchPair.src.dpId, it) }
[protectedFlow, singleFlow, defaultFlow].each { flowHelperV2.deleteFlow(it.flowId) }
doPortDowns && topology.getBusyPortsForSwitch(switchPair.src).each { antiflap.portUp(switchPair.src.dpId, it) }
Wrappers.wait(discoveryInterval + WAIT_OFFSET) {
northbound.getAllLinks().each { assert it.state != IslChangeType.FAILED }
}
Expand Down
64 changes: 42 additions & 22 deletions src-java/testing/performance-tests/kilda.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,62 @@ floodlight.regions=1,2
floodlight.alive.timeout=10
floodlight.alive.interval=2

grpc.endpoint=http://localhost:8091
grpc.username=kilda
grpc.password=kilda
grpc.remote.log.server.ip=1.1.1.1
grpc.remote.log.server.port=321

elasticsearch.endpoint = http://localhost:9200
elasticsearch.username = kilda
elasticsearch.password = kilda

kafka.bootstrap.server = kafka.pendev:9092
kafka.topic.topo.disco=kilda.topo.disco

lockkeeper.endpoint=http://localhost:5001
neo.uri=bolt://localhost:7687
neo.user=
neo.password=

elasticsearch.endpoint=http://localhost:9200
elasticsearch.username=kilda
elasticsearch.password=kilda
elasticsearch.index=kilda-*

environment.naming.prefix=
kafka.bootstrap.server=kafka.pendev:9092
kafka.topic.topo.disco=kilda.topo.disco.storm

lab-api.endpoint=http://localhost:8288
lockkeeper.port=5001

opentsdb.endpoint=http://localhost:4242
opentsdb.metric.prefix=kilda.

spring.profiles.active=virtual
mode.topology.single=true

reroute.delay=3
reroute.hardtimeout=15
reroute.delay=2
reroute.hardtimeout=8

discovery.interval=3
discovery.timeout = 15
discovery.timeout=15

antiflap.min=1
antiflap.warmup=5
antiflap.cooldown=10
burst.coefficient=1.05
pce.isl.cost.when.under.maintenance=10000
antiflap.warmup=3
antiflap.cooldown=7

pce.isl.cost.when.unstable=10000
pce.isl.cost.when.under.maintenance=10000

isl.unstable.timeout.sec=15

burst.coefficient=1.05

bfd.offset=200

env.hardware.cleanup=false

diversity.isl.cost=10000
diversity.switch.cost=1000

grpc.endpoint=http://localhost:8091
grpc.username=kilda
grpc.password=kilda
#please use the correct ip address and port for the remote log server
grpc.remote.log.server.ip=1.1.1.1
grpc.remote.log.server.port=321

use.hs=true
use.multitable=true
cleanup.verifier=true

flow.ping.interval=5
#debug=true for local debugging (less load), false for running at real perf environment
perf.debug=true
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ class TopologyHelper extends org.openkilda.functionaltests.helpers.TopologyHelpe
}
def topo = new CustomTopology()
switchesAmount.times { i ->
def region = i % regions.take(2).size() //TODO(rtretiak): to remove 'take' when stage env deals with '3' region
topo.addCasualSwitch("${managementControllers[region]} ${statControllers[region]}")
def regionIndex = i % regions.size()
topo.addCasualSwitch("${managementControllers[regionIndex]} ${statControllers[regionIndex]}",
regions[regionIndex])
}
//form a line of switches
def allSwitches = topo.getSwitches()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class CustomTopology extends TopologyDefinition {
* @param controller Which controller the new switch should be connected to
* @return the added switch
*/
Switch addCasualSwitch(String controller) {
Switch addCasualSwitch(String controller, String region) {
def swId = new SwitchId(faker.internet().macAddress())
def sw = Switch.factory("sw${switches.size() + 1}", swId, "OF_13", Status.Active,
def sw = Switch.factory("sw${switches.size() + 1}", swId, "OF_13", Status.Active, region,
null, null, controller)
switches << sw
return sw
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.openkilda.functionaltests.helpers.FlowHelperV2
import org.openkilda.functionaltests.helpers.PathHelper
import org.openkilda.functionaltests.helpers.PortAntiflapHelper
import org.openkilda.messaging.model.system.FeatureTogglesDto
import org.openkilda.messaging.model.system.KildaConfigurationDto
import org.openkilda.performancetests.helpers.TopologyHelper
import org.openkilda.testing.service.database.Database
import org.openkilda.testing.service.labservice.LabService
Expand Down Expand Up @@ -65,6 +66,9 @@ class BaseSpecification extends Specification implements SetupOnce {
@Value('${use.hs}')
boolean useHs

@Value('${use.multitable}')
boolean useMultitable

@Value('${perf.debug}')
boolean debug

Expand All @@ -91,6 +95,7 @@ class BaseSpecification extends Specification implements SetupOnce {
.flowsRerouteViaFlowHs(useHs)
.build()
northbound.toggleFeature(features)
northbound.updateKildaConfiguration(KildaConfigurationDto.builder().useMultiTable(useMultitable).build())
}

def setup() {
Expand Down
Loading

0 comments on commit 921d109

Please sign in to comment.