# ! /usr/bin/env python # -*- coding: utf-8 -*- import time import grpc from concurrent import futures from proto import AlgorithmSupport_pb2, AlgorithmSupport_pb2_grpc if __name__ == "__main__": channel = grpc.insecure_channel("localhost:50050") stub = AlgorithmSupport_pb2_grpc.AlgorithmSupportServiceStub(channel) # # è½èè¯ä¼°è¯·æ± # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", serviceType="vm", startTimestamp="1568440031", # endTimestamp="1568440031", algorithm="regtree")) # pod åè§£ç¸å ³è¯·æ± # res = stub.AlgorithmSupport( # AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="linpack11", serviceType="pod_e", startTimestamp="1568440021", # endTimestamp="1568440030", algorithm="regtree")) # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="linpack11", serviceType="pod_e", startTimestamp="1568440021", # endTimestamp="1568440030", algorithm="direct")) # # 硬件è½èåè§£è¯·æ± res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", serviceType="hardware", startTimestamp="1568440021", endTimestamp="1568440022", algorithm="xgboost")) # è½è颿µè¯·æ± # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", startTimestamp="1568294221", # endTimestamp="1568440030", algorithm="rf", # serviceType="server")) # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", startTimestamp="1568294221", # endTimestamp="1568440030", algorithm="lstmx2", # serviceType="server")) # res = stub.AlgorithmSupport( # AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", startTimestamp="1568294221", # endTimestamp="1568440030", algorithm="tcn", # serviceType="server")) # res = stub.AlgorithmSupport( # AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", startTimestamp="1568294221", # endTimestamp="1568440030", algorithm="arima", # serviceType="server")) # res = stub.AlgorithmSupport( # AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", startTimestamp="1568294221", # endTimestamp="1568440030", algorithm="darnn", # serviceType="server")) # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="compute01", startTimestamp="1568510700", endTimestamp="1568510709", algorithm="empty")) # # pod è½è颿µ # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(entityID="linpack11", startTimestamp="1568440021", endTimestamp="1568440030", # algorithm="rf", serviceType="pod")) # # 硬件è½èåè§£è¯·æ± # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(serviceType="qos", entityID="compute01", # startTimestamp="1568294221", endTimestamp="1568294222", # algorithm="brb")) # res = stub.AlgorithmSupport(AlgorithmSupport_pb2.AlgorithmSupportRequest(serviceType="dc", entityID="datacenter", # startTimestamp="1568440167", endTimestamp="1568440168", # algorithm="membership")) print(res)