Beispiel #1
0
class TSExperimentProfileInfo(tso):
    profileId = tso.Int()
    
    userId = tso.Int()
    
    description = tso.String()
    creationDate = tso.Int()
Beispiel #2
0
class TSWorkloadType(tso):
    module = tso.String()
    path = tso.String()

    wlclass = tso.Array(tso.String())

    params = tso.Map(TSWorkloadParameter)
Beispiel #3
0
class TSUserDescriptor(tso):
    name = tso.String()
    
    # See tsload.jsonts.server.TSServerClient - AUTH_* contstants
    AUTH_ADMIN = 2
    AUTH_OPERATOR = 3
    AUTH_USER = 4
    
    role = tso.Int()
Beispiel #4
0
class TSAgentResource(tso):
    resId = tso.Int()
    
    resClass = tso.String()
    resType = tso.String()
    
    data = tso.Any()
    
    state = tso.Int()
Beispiel #5
0
class TSExperimentThreadPool(tso):
    agentId = tso.Nullable(tso.Int())
    numWorkers = tso.Int()
    
    @staticmethod
    def createEmptyThreadPool():
        threadpool = TSExperimentThreadPool()
        
        threadpool.agentId = None
        threadpool.numWorkers = 0
        
        return threadpool
Beispiel #6
0
class TSAgentDescriptor(tso):
    hostname = tso.String()

    domainname = tso.String()
    osname = tso.String()
    release = tso.String()
    machineArch = tso.String()

    numCPUs = tso.Int()
    numCores = tso.Int()
    memTotal = tso.Int()
Beispiel #7
0
class TSExperimentProfile(TSExperimentProfileInfo):    
    threadpools = tso.Map(tso.Object(TSExperimentThreadPool))
    workloads = tso.Map(tso.Object(TSExperimentWorkload))

    @staticmethod
    def createEmptyProfile():
        profile = TSExperimentProfile()
        
        profile.profileId = -1
        
        profile.threadpools = {}
        profile.workloads = {}
        
        profile.description = ""
        
        profile.userId = -1
        profile.creationDate = -1
        
        return profile
Beispiel #8
0
class RootAgent(TSAgentInterface):
    hello = TSMethod(tso.Object(TSHelloResponse),
                     agentType=tso.String(),
                     agentUuid=tso.String())

    authMasterKey = TSMethod(masterKey=tso.String())

    listClients = TSMethod(tso.Array(tso.Object(TSClientDescriptor)))
Beispiel #9
0
class TSClientDescriptor(tso):
    id = tso.Int()
    type = tso.String()
    uuid = tso.String()
    authType = tso.Int()

    # See JSONTS.STATE_*
    state = tso.Int()

    endpoint = tso.String()
Beispiel #10
0
 def __init__(self, returnObj = TSObject.Null(), **kw):
     ''' Method definition - defines method in agent interface in 
     tsload.jsonts.api.* modules.
     
     @param returnObj    return type serdes from jsonts.object. Default is Null
     @param kw           keyword arguments. Names of arguments match with keys in
     protocol.
      '''
     self.returnObj = returnObj
     self.args = kw
     
     self.deserializeResult = partial(self.serdesResult, 
                                      returnObj.deserialize)
     self.serializeResult = partial(self.serdesResult, 
                                    returnObj.serialize)
     
     self.serializeArgs = partial(self.serdesArgs, 'serialize')
     self.deserializeArgs = partial(self.serdesArgs, 'deserialize')
Beispiel #11
0
class TSExperimentWorkload(tso):
    agentId = tso.Nullable(tso.Int())
    workloadType = tso.Nullable(tso.String())
    
    threadpool = tso.Nullable(tso.String())
    params = tso.Any()
    
    @staticmethod
    def createEmptyWorkload():
        workload = TSExperimentWorkload()
        
        workload.agentId = None
        workload.workloadType = None
        workload.threadpool = None
        workload.params = {}
        
        return workload
Beispiel #12
0
class LoadAgent(TSAgentInterface):
    getHostInfo = TSMethod(tso.Object(TSAgentDescriptor))

    getWorkloadTypes = TSMethod(tso.Map(TSWorkloadType))
    getResources = TSMethod(tso.Map(tso.Map(TSResource)))
Beispiel #13
0
class TSAgentResourceInfo(tso):
    resources = tso.Map(TSAgentResource)
    childLinks = tso.Array(TSAgentResourceChild)
Beispiel #14
0
class TSAgentResourceChild(tso):
    parentName = tso.String()
    childName = tso.String()
Beispiel #15
0
class TSWLParamCommon(tso):
    WLPF_NO_FLAGS = 0x00
    WLPF_OPTIONAL = 0x01

    flags = tso.Int()
    description = tso.String()
Beispiel #16
0
class TSExpSvcAgentDescriptor(TSAgentDescriptor):
    agentId = tso.Int()
    
    isOnline = tso.Bool()
    lastOnline = tso.Int()
Beispiel #17
0
class TSWLParamString(TSWLParamCommon):
    default = tso.Optional(tso.String())
    len = tso.Int()
Beispiel #18
0
class UserAgent(TSAgentInterface):
    authUser = TSMethod(tso.Object(TSUserDescriptor),
                        userName = tso.String(),
                        userPassword = tso.String())
Beispiel #19
0
class TSWLParamBoolean(TSWLParamCommon):
    default = tso.Optional(tso.Bool())
Beispiel #20
0
class TSWLParamInteger(TSWLParamCommon):
    default = tso.Optional(tso.Int())
    min = tso.Optional(tso.Int())
    max = tso.Optional(tso.Int())
Beispiel #21
0
class TSHelloResponse(tso):
    agentId = tso.Int()
Beispiel #22
0
class TSWLParamStringSet(TSWLParamCommon):
    strset = tso.Array(tso.String())
    default = tso.Optional(tso.String())
Beispiel #23
0
class TSResource(tso):
    children = tso.Array(tso.String())
    type = tso.String()
    data = tso.Any()
Beispiel #24
0
class ExpSvcAgent(TSAgentInterface):
    listAgents = TSMethod(tso.Map(tso.Object(TSExpSvcAgentDescriptor)))
    
    getWorkloadTypes = TSMethod(tso.Map(tso.Object(TSWorkloadType)),
                                agentId = tso.Int())
    getAgentResources = TSMethod(tso.Object(TSAgentResourceInfo),
                                 agentId = tso.Int())
    
    listProfiles = TSMethod(tso.Map(tso.Object(TSExperimentProfileInfo)))
    
    getProfile = TSMethod(tso.Object(TSExperimentProfile),
                          profileName = tso.String(),
                          profile = tso.Object(TSExperimentProfileInfo))
    
    configureProfile = TSMethod(profileName = tso.String(),
                                profile = tso.Object(TSExperimentProfile))
Beispiel #25
0
    # null, - Unresolvable
    "bool": TSWLParamBoolean,
    "integer": TSWLParamInteger,
    "float": TSWLParamFloat,
    "string": TSWLParamString,
    "strset": TSWLParamStringSet,

    # metatypes
    "size": TSWLParamSize,
    "time": TSWLParamTime,
    "filepath": TSWLParamFilePath,
    "cpuobject": TSWLParamCPUObject,
    "disk": TSWLParamDisk
}

TSWorkloadParameter = tso.MultiObject('type', tsWLParamClassMap)


class TSWorkloadType(tso):
    module = tso.String()
    path = tso.String()

    wlclass = tso.Array(tso.String())

    params = tso.Map(TSWorkloadParameter)


class TSResource(tso):
    children = tso.Array(tso.String())
    type = tso.String()
    data = tso.Any()
Beispiel #26
0
class TSWLParamFloat(TSWLParamCommon):
    default = tso.Optional(tso.Float())
    min = tso.Optional(tso.Float())
    max = tso.Optional(tso.Float())