class CallTimer extends AnyRef
Object used to record and retrieve results for external system calls. There will be a timer that shows response times without external services, as well as record the time used for this service.
- Alphabetic
- By Inheritance
- CallTimer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
CallTimer(registries: MetricRegistries, configuration: Configuration)
- Annotations
- @Inject()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val externalHttpPrefix: String
- val externalNonHttpPrefix: String
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
measureExternalHttpCall[T](requestId: Option[Long], name: String = "external-service", httpMethod: String = "GET", responseCodeFunction: (T) ⇒ Int = data: T => Status.OK)(call: Future[T])(implicit executionContext: ExecutionContext): Future[T]
Helper function that measures the time needed for a given future to complete, taking this as an external call.
Helper function that measures the time needed for a given future to complete, taking this as an external call. Used only for HTTP calls returning a numeric response code. Failed futures will not record anything, you need to take care to recover yourself beforehand.
- T
The type that the call returns
- requestId
The request id of the call, if any
- name
the name of the external service
- httpMethod
the http method that the call uses
- responseCodeFunction
a function that can map from the data of the result of the call to an http result code
- call
the call that should be performed
- returns
A Future that also measures the time needed to be completed
-
def
measureExternalNonHttpCall[T](requestId: Option[Long], name: String = "external-service", method: String = "READ", responseCodeFunction: (T) ⇒ String = data: T => "OK")(call: Future[T])(implicit executionContext: ExecutionContext): Future[T]
Helper function that measures the time needed for a given future to complete, taking this as an external call.
Helper function that measures the time needed for a given future to complete, taking this as an external call. Used only for non-HTTP calls. These calls may have any response code type. Failed futures will not record anything, you need to take care to recover yourself beforehand.
- T
The type that the call returns
- requestId
The request id of the call, if any
- name
the name of the external service
- method
the method that the call uses. Defaults to "READ", may be any string. Proposal: READ / WRITE / EXECUTE.
- responseCodeFunction
a function that can map from the data of the result of the call to an http result code
- call
the call that should be performed
- returns
A Future that also measures the time needed to be completed
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
readExternalCallTimes(requestId: Long): Duration
Reads aggregated external call times that have been recorded with above functions and a given request id.
-
def
recordExternalHttpCall(requestId: Option[Long], duration: Duration, name: String = "external-service", httpMethod: String = "GET", responseCode: Int = Status.OK): Unit
Used to record an external http call that has been performed without using the Future that created it.
Used to record an external http call that has been performed without using the Future that created it. May be useful if either your call is synchronous.
-
def
recordExternalNonHttpCall(requestId: Option[Long], duration: Duration, name: String = "external-service", method: String = "READ", responseCode: String = "OK"): Unit
Used to record an external call that has been performed without using the Future that created it.
Used to record an external call that has been performed without using the Future that created it. May be useful if either your call is synchronous.
- def recordFailedExternalHttpCall(requestId: Option[Long], duration: Duration, name: String, httpMethod: String): Unit
- val registry: MetricRegistry
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )