Add a facility for automated performance measurement
We want to be able to summarize the behavior of the shell's performance in a series of "metrics", like the latency between clicking on the Activities button and seeing a response. This patch adds the ability to create a script under perf/ in a special format that automates a series of actions in the shell, writing events to the performance log, then collects statistics as the log as replayed and turns them into a set of metrics. The script is then executed by running as gnome-shell --perf=<script>. The 'core' script which is added here will be the primary performance measurement script that we use for shell performance regression testing; right now it has a couple of placeholder metrics. https://bugzilla.gnome.org/show_bug.cgi?id=618189
This commit is contained in:
@ -29,6 +29,7 @@ const RunDialog = imports.ui.runDialog;
|
||||
const LookingGlass = imports.ui.lookingGlass;
|
||||
const NotificationDaemon = imports.ui.notificationDaemon;
|
||||
const WindowAttentionHandler = imports.ui.windowAttentionHandler;
|
||||
const Scripting = imports.ui.scripting;
|
||||
const ShellDBus = imports.ui.shellDBus;
|
||||
const TelepathyClient = imports.ui.telepathyClient;
|
||||
const WindowManager = imports.ui.windowManager;
|
||||
@ -180,6 +181,13 @@ function start() {
|
||||
log('GNOME Shell started at ' + _startDate);
|
||||
|
||||
Mainloop.idle_add(_removeUnusedWorkspaces);
|
||||
|
||||
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
|
||||
if (perfModuleName) {
|
||||
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
|
||||
let module = eval('imports.perf.' + perfModuleName + ';');
|
||||
Scripting.runPerfScript(module, perfOutput);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user