Fix typo in config example and update some build deps.

This commit is contained in:
Mark Nellemann 2023-05-10 10:54:41 +02:00
parent 3b9119f9ad
commit 708302d1ab
4 changed files with 5 additions and 142 deletions

View file

@ -20,12 +20,12 @@ group = projectGroup
version = projectVersion
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.7.1'
implementation 'info.picocli:picocli:4.7.1'
annotationProcessor 'info.picocli:picocli-codegen:4.7.3'
implementation 'info.picocli:picocli:4.7.3'
implementation 'org.influxdb:influxdb-java:2.23'
//implementation 'com.influxdb:influxdb-client-java:6.7.0'
implementation 'org.slf4j:slf4j-api:2.0.6'
implementation 'org.slf4j:slf4j-simple:2.0.6'
implementation 'org.slf4j:slf4j-api:2.0.7'
implementation 'org.slf4j:slf4j-simple:2.0.7'
implementation 'com.squareup.okhttp3:okhttp:4.10.0' // Also used by InfluxDB Client
//implementation "org.eclipse.jetty:jetty-client:9.4.49.v20220914"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2'

View file

@ -12,18 +12,15 @@ password = ""
database = "svci"
###
### Define one or more SVC's to query for metrics
### Each entry must be named [svc.<something-unique>]
###
# SVC to query for data and metrics
[svc.site1]
url = "https://10.10.10.5:7443"
username = "superuser"
password = "password"
refresh = 30 # How often to query HMC for data - in seconds
refresh = 30 # How often to query SVC for data - in seconds
trust = true # Ignore SSL cert. errors (due to default self-signed cert.)

View file

@ -1,22 +0,0 @@
package biz.nellemann.svci
import biz.nellemann.svci.dto.toml.InfluxConfiguration
import spock.lang.Ignore
import spock.lang.Specification
@Ignore
class InfluxClientTest extends Specification {
InfluxClient influxClient
def setup() {
influxClient = new InfluxClient(new InfluxConfiguration("http://localhost:8086", "root", "", "svci"))
influxClient.login()
}
def cleanup() {
influxClient.logoff()
}
}

View file

@ -1,112 +0,0 @@
package biz.nellemann.svci
import org.mockserver.integration.ClientAndServer
import org.mockserver.logging.MockServerLogger
import org.mockserver.socket.PortFactory
import org.mockserver.socket.tls.KeyStoreFactory
import spock.lang.Ignore
import spock.lang.Shared
import spock.lang.Specification
import javax.net.ssl.HttpsURLConnection
@Ignore
class VolumeControllerTest extends Specification {
@Shared
private static ClientAndServer mockServer;
@Shared
private RestClient serviceClient
@Shared
private VolumeController volumeController
@Shared
private File metricsFile
def setupSpec() {
HttpsURLConnection.setDefaultSSLSocketFactory(new KeyStoreFactory(new MockServerLogger()).sslContext().getSocketFactory());
mockServer = ClientAndServer.startClientAndServer(PortFactory.findFreePort());
serviceClient = new RestClient(String.format("http://localhost:%d", mockServer.getPort()), "user", "password", false)
MockResponses.prepareClientResponseForLogin(mockServer)
//MockResponses.prepareClientResponseForManagementConsole(mockServer)
//MockResponses.prepareClientResponseForManagedSystem(mockServer)
//MockResponses.prepareClientResponseForVirtualIOServer(mockServer)
//MockResponses.prepareClientResponseForLogicalPartition(mockServer)
serviceClient.login()
volumeController = new VolumeController(serviceClient, );
volumeController.discover()
}
def cleanupSpec() {
mockServer.stop()
}
def setup() {
}
def "test we got entry"() {
expect:
volumeController.entry.getName() == "Server-9009-42A-SN21F64EV"
}
void "test getDetails"() {
when:
volumeController.deserialize(metricsFile.getText('UTF-8'))
List<Measurement> listOfMeasurements = volumeController.getDetails()
then:
listOfMeasurements.size() == 1
listOfMeasurements.first().tags['servername'] == 'Server-9009-42A-SN21F64EV'
listOfMeasurements.first().fields['utilizedProcUnits'] == 0.00458
listOfMeasurements.first().fields['assignedMem'] == 40448.0
}
void "test getMemoryMetrics"() {
when:
volumeController.deserialize(metricsFile.getText('UTF-8'))
List<Measurement> listOfMeasurements = volumeController.getMemoryMetrics()
then:
listOfMeasurements.size() == 1
listOfMeasurements.first().fields['totalMem'] == 1048576.000
}
void "test getProcessorMetrics"() {
when:
volumeController.deserialize(metricsFile.getText('UTF-8'))
List<Measurement> listOfMeasurements = volumeController.getProcessorMetrics()
then:
listOfMeasurements.size() == 1
listOfMeasurements.first().fields['availableProcUnits'] == 4.65
}
void "test getSystemSharedProcessorPools"() {
when:
volumeController.deserialize(metricsFile.getText('UTF-8'))
List<Measurement> listOfMeasurements = volumeController.getSharedProcessorPools()
then:
listOfMeasurements.size() == 4
listOfMeasurements.first().fields['assignedProcUnits'] == 22.00013
}
void "test getPhysicalProcessorPool"() {
when:
volumeController.deserialize(metricsFile.getText('UTF-8'))
List<Measurement> listOfMeasurements = volumeController.getPhysicalProcessorPool()
then:
listOfMeasurements.size() == 1
listOfMeasurements.first().fields['assignedProcUnits'] == 22.0
}
}