info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
You can enable service measurement in order to debug any slow service's execution time, number of SQL calls, garbage collection stats, memory usage, etc.
## Measuring module
The measuring module is a tool that allows to measure a service's execution, and log:
The measuring module will log these measurements into a structured log called [`service_measurement.log`](../administration/logs.md#service_measurementlog),
as a single entry for each service execution.
For GitLab.com, `service_measurement.log` is ingested in Elasticsearch and Kibana as part of our monitoring solution.
## How to use it
The measuring module allows you to easily measure and log execution of any service,
by just prepending `Measurable` in any Service class, on the last line of the file that the class resides in.
For example, to prepend a module into the `DummyService` class, you would use the following approach:
```ruby
class DummyService
def execute
# ...
end
end
DummyService.prepend(Measurable)
```
In case when you are prepending a module from the `EE` namespace with EE features, you need to prepend Measurable after prepending the `EE` module.
This way, `Measurable` will be at the bottom of the ancestor chain, in order to measure execution of `EE` features as well:
```ruby
class DummyService
def execute
# ...
end
end
DummyService.prepend_if_ee('EE::DummyService')
DummyService.prepend(Measurable)
```
### Log additional attributes
In case you need to log some additional attributes, it is possible to define `extra_attributes_for_measurement` in the service class: