# ApplicationNode represents this node is under monitoring by agent.
type ApplicationNode implements Node {
    id: ID!
    name: String!
    type: String
    # Success rate of all incoming requests.
    # Max value is 100.
    # 2 Digits after floating point.
    sla: Float!
    # The number of incoming calls
    callsPerSec: Long!
    # Unit: millisecond
    responseTimePerSec: Long!
    # ref: http://www.apdex.org/
    # Max value is 1
    # 2 Digits after floating point.
    apdex: Float!
    # Whether the application alerts?
    # Default value is false.
    isAlarm: Boolean!
    # The number of servers in the application code
    numOfServer: Int!
    # The number of servers alerting
    numOfServerAlarm: Int!
    # The number of services alerting
    numOfServiceAlarm: Int!
}

# The conjectural node generated by exit span
type ConjecturalNode implements Node {
    id: ID!
    name: String!
    type: String
}

type Application {
    id: ID!
    name: String!
    # The number of servers in the application code
    numOfServer: Int!
}

extend type Query {
  getAllApplication(duration: Duration!): [Application!]!
  getApplicationTopology(applicationId: ID!, duration: Duration!): Topology
  getSlowService(applicationId: ID!, duration: Duration!, topN: Int!): [ServiceMetric!]!
  getServerThroughput(applicationId: ID!, duration: Duration!, topN: Int!): [AppServerInfo!]!
}
