Profiling the execution of a release
Executing a release consists in running a set of release actions.
If there are slowdowns it can be useful to profile the execution to determine what is slow. One way to profile the execution of a release is by measuring the time it takes to execute every action.
This pages how to profile the execution of release actions. There are two ways to main ways to approach this:
- execute the release in-image and analyse the Logging with Beacon signals raised during execution
- parse a releaser log, recreating the Logging with Beacon signals raised during execution
Profiling the execution of a release inside the image
One way to profile a release is to directly execute it inside the image.
GtBeaconEventsCollector subclass: #GtRlReleaserEventsCollector
provides a way to monitor releaser actions. The simplest way is to use the default instance of the collector.
Aternatively we can create a new collector instance.
eventsCollector := GtRlReleaserEventsCollector new
In case multiple instance of the collector are registered, the snippet below will stop them and also remove all content.
GtRlReleaserEventsCollector allInstances do: #stop
GtRlReleaserEventsCollector allInstances do: #reset
The collector uses Beacon signals subclassing
GtRlActionSignal subclass: #GtRlActionExecutionSignal
instanceVariableNames: 'actionType actionOrder actionDescription repositoryId versionDescription'
. It is also possible to listen for those events directly using beacon.
logger := MemoryLogger startFor: GtRlActionExecutionSignal.
Parsing a releaser log
We can also parse a release log and recreate Beacon events raised during execution.
Object subclass: #GtRlReleaserSignalsLogReader
provides the logic for parsing. It creates a
GtBeaconEventsGrouper subclass: #GtRlReleaserEventsGrouper
that provides various ways to inspect the log.
The snippets below load a log takes from the clipboard.
readStream := Clipboard clipboardText asString readStream
eventsGrouper := GtRlReleaserSignalsLogReader readFrom: readStream