Tracks a single operation - an HTTP request or an async job - while it is running on this server, so it can be inspected and killed from the server monitoring pages. One is created when the operation starts and removed when it finishes; a short history of errored operations is kept separately by CurrentOperationService. Serialised as a "CurrentOp" element.
Group: Server Monitoring
Properties
| Property | Returns | Description |
|---|---|---|
| attributes | Map<String,Object> | A bag of temporary attributes for this operation. Delegates to the HTTP request's attributes if this is an HTTP operation, otherwise uses a local map. |
| blocked | boolean | Whether this operation's time limit marks it as blocked outright, rather than merely capped. |
| branchId | Long | The ID of the branch (website section) this operation is running against, if applicable. |
| completedAt | Date | When this operation finished. |
| currentAction | OpAction | What this operation is currently doing, eg executing a SQL statement or an Elasticsearch call. |
| error | boolean | Whether this operation ended, or has so far logged, an error. |
| errorMessage | String | The message logged when this operation ended in an error. |
| httpMethod | String | The HTTP method of the request this operation is handling, eg GET or POST. |
| httpParams | Map<String,String> | The HTTP request parameters for this operation. Returns the params captured at the time of a violation if any were captured, otherwise the live request's current params. |
| killed | boolean | Whether this operation has been flagged to be killed. |
| operationInfo | OperationInfo | Identifying details of this operation - its type, source and item ID. |
| request | Request | The HTTP request this operation is handling. |
| response | Response | The HTTP response this operation is writing to. |
| serverName | String | The name of the server this operation is running on. |
| stackTrace | StackTraceElement[] | The stack trace of the operation's thread. While the operation is still running this is the thread's live stack trace; once it has finished this is the stack trace captured at the time of a violation or error, if any. |
| startedAt | Date | When this operation started. |
| tenantId | Long | The ID of the tenant organisation this operation is running for. |
| threadId | String | The name of the thread this operation is running on. |
| thrown | Throwable | The exception thrown by this operation, if it ended in an error. |
| timeLimit | long | The maximum time in milliseconds this operation is allowed to run, as calculated by the Governor. |
| timeLimitExceeded | boolean | Whether this operation has run for longer than its configured time limit. |
| topStack | List<String> | The top few stack frames captured when this operation's stack trace was recorded (eg on a violation), as a quick reference to what it was waiting on. |
| violation | boolean | Whether this operation has been flagged as violating server limits, eg by exceeding its time limit. |
Methods
getCurrentAction() · getServerName() · getAttributes() · getBranchId() · getHttpMethod() · getRequest() · getResponse() · getThreadId() · getOperationInfo() · getTenantId() · getStartedAt() · getCompletedAt() · getStackTrace() · getTopStack() · getThrown() · getErrorMessage() · getTimeLimit() · isBlocked() · isTimeLimitExceeded() · isError() · isViolation() · isKilled() · getHttpParams()
getCurrentAction()
Returns: OpAction
What this operation is currently doing, eg executing a SQL statement or an Elasticsearch call.
getServerName()
Returns: String
The name of the server this operation is running on.
getAttributes()
Returns: Map<String,Object>
A bag of temporary attributes for this operation. Delegates to the HTTP request's attributes if this is an HTTP operation, otherwise uses a local map.
getBranchId()
Returns: Long
The ID of the branch (website section) this operation is running against, if applicable.
getHttpMethod()
Returns: String
The HTTP method of the request this operation is handling, eg GET or POST.
getRequest()
Returns: Request
The HTTP request this operation is handling.
getResponse()
Returns: Response
The HTTP response this operation is writing to.
getThreadId()
Returns: String
The name of the thread this operation is running on.
getOperationInfo()
Returns: OperationInfo
Identifying details of this operation - its type, source and item ID.
getTenantId()
Returns: Long
The ID of the tenant organisation this operation is running for.
getStartedAt()
Returns: Date
When this operation started.
getCompletedAt()
Returns: Date
When this operation finished.
getStackTrace()
Returns: StackTraceElement[]
The stack trace of the operation's thread. While the operation is still running this is the thread's live stack trace; once it has finished this is the stack trace captured at the time of a violation or error, if any.
getTopStack()
Returns: List<String>
The top few stack frames captured when this operation's stack trace was recorded (eg on a violation), as a quick reference to what it was waiting on.
getThrown()
Returns: Throwable
The exception thrown by this operation, if it ended in an error.
getErrorMessage()
Returns: String
The message logged when this operation ended in an error.
getTimeLimit()
Returns: long
The maximum time in milliseconds this operation is allowed to run, as calculated by the Governor.
isBlocked()
Returns: boolean
Whether this operation's time limit marks it as blocked outright, rather than merely capped.
isTimeLimitExceeded()
Returns: boolean
Whether this operation has run for longer than its configured time limit.
isError()
Returns: boolean
Whether this operation ended, or has so far logged, an error.
isViolation()
Returns: boolean
Whether this operation has been flagged as violating server limits, eg by exceeding its time limit.
isKilled()
Returns: boolean
Whether this operation has been flagged to be killed.
getHttpParams()
Returns: Map<String,String>
The HTTP request parameters for this operation. Returns the params captured at the time of a violation if any were captured, otherwise the live request's current params.