eventlooplag.js 734 B

1234567891011121314151617181920212223242526272829303132
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol");
  6. const eventLoopLagSpec = generateActorSpec({
  7. typeName: "eventLoopLag",
  8. events: {
  9. "event-loop-lag": {
  10. type: "event-loop-lag",
  11. // duration of the lag in milliseconds.
  12. time: Arg(0, "number")
  13. }
  14. },
  15. methods: {
  16. start: {
  17. request: {},
  18. response: {success: RetVal("number")}
  19. },
  20. stop: {
  21. request: {},
  22. response: {}
  23. }
  24. }
  25. });
  26. exports.eventLoopLagSpec = eventLoopLagSpec;