kopia lustrzana https://github.com/c9/core
Merge pull request +7107 from c9/error-metrics
Add client-side error metrics, docker checkpull/85/head
commit
72f54d6d59
|
@ -1,11 +1,12 @@
|
||||||
define(function(require, module, exports) {
|
define(function(require, module, exports) {
|
||||||
main.consumes = ["Dialog", "util", "dialog.alert"];
|
main.consumes = ["Dialog", "util", "dialog.alert", "metrics"];
|
||||||
main.provides = ["dialog.alert_internal"];
|
main.provides = ["dialog.alert_internal"];
|
||||||
return main;
|
return main;
|
||||||
|
|
||||||
function main(options, imports, register) {
|
function main(options, imports, register) {
|
||||||
var Dialog = imports.Dialog;
|
var Dialog = imports.Dialog;
|
||||||
var util = imports.util;
|
var util = imports.util;
|
||||||
|
var metrics = imports.metrics;
|
||||||
var alertWrapper = imports["dialog.alert"];
|
var alertWrapper = imports["dialog.alert"];
|
||||||
|
|
||||||
/***** Initialization *****/
|
/***** Initialization *****/
|
||||||
|
@ -25,6 +26,8 @@ define(function(require, module, exports) {
|
||||||
/***** Methods *****/
|
/***** Methods *****/
|
||||||
|
|
||||||
function show(title, header, msg, onhide, options) {
|
function show(title, header, msg, onhide, options) {
|
||||||
|
metrics.increment("dialog.error");
|
||||||
|
|
||||||
return plugin.queue(function(){
|
return plugin.queue(function(){
|
||||||
if (header === undefined) {
|
if (header === undefined) {
|
||||||
plugin.title = "Notice";
|
plugin.title = "Notice";
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
main.consumes = ["Plugin", "ui"];
|
main.consumes = ["Plugin", "ui", "metrics"];
|
||||||
main.provides = ["dialog.error"];
|
main.provides = ["dialog.error"];
|
||||||
return main;
|
return main;
|
||||||
|
|
||||||
function main(options, imports, register) {
|
function main(options, imports, register) {
|
||||||
var Plugin = imports.Plugin;
|
var Plugin = imports.Plugin;
|
||||||
var ui = imports.ui;
|
var ui = imports.ui;
|
||||||
|
var metrics = imports.metrics;
|
||||||
|
|
||||||
/***** Initialization *****/
|
/***** Initialization *****/
|
||||||
|
|
||||||
|
@ -84,6 +85,8 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function show(message, timeout) {
|
function show(message, timeout) {
|
||||||
|
metrics.increment("dialog.error");
|
||||||
|
|
||||||
// Error message container
|
// Error message container
|
||||||
if (!error) {
|
if (!error) {
|
||||||
error = document.body.appendChild(document.createElement("div"));
|
error = document.body.appendChild(document.createElement("div"));
|
||||||
|
|
|
@ -8,7 +8,7 @@ define(function(require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
main.consumes = [
|
main.consumes = [
|
||||||
"Plugin", "info"
|
"Plugin", "info", "metrics"
|
||||||
];
|
];
|
||||||
main.provides = ["error_handler"];
|
main.provides = ["error_handler"];
|
||||||
return main;
|
return main;
|
||||||
|
@ -16,6 +16,7 @@ define(function(require, exports, module) {
|
||||||
function main(options, imports, register) {
|
function main(options, imports, register) {
|
||||||
var Plugin = imports.Plugin;
|
var Plugin = imports.Plugin;
|
||||||
var info = imports.info;
|
var info = imports.info;
|
||||||
|
var metrics = imports.metrics;
|
||||||
|
|
||||||
/***** Initialization *****/
|
/***** Initialization *****/
|
||||||
|
|
||||||
|
@ -57,7 +58,8 @@ define(function(require, exports, module) {
|
||||||
Raygun.setVersion(version + ".0");
|
Raygun.setVersion(version + ".0");
|
||||||
}
|
}
|
||||||
|
|
||||||
function reportError(exception, customData, tags) {
|
function log(exception, customData, tags) {
|
||||||
|
metrics.increment("errorhandler.log");
|
||||||
if (typeof exception === "string")
|
if (typeof exception === "string")
|
||||||
exception = new Error(exception);
|
exception = new Error(exception);
|
||||||
if (!exception)
|
if (!exception)
|
||||||
|
@ -78,8 +80,8 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
plugin.freezePublicAPI({
|
plugin.freezePublicAPI({
|
||||||
/** @deprecated Use log() instead. */
|
/** @deprecated Use log() instead. */
|
||||||
reportError: reportError,
|
reportError: log,
|
||||||
log: reportError
|
log: log
|
||||||
});
|
});
|
||||||
|
|
||||||
register(null, { "error_handler" : plugin });
|
register(null, { "error_handler" : plugin });
|
||||||
|
|
|
@ -414,6 +414,11 @@ require([
|
||||||
"metrics": {
|
"metrics": {
|
||||||
getLastPing: function() { throw Error("Not implemented"); },
|
getLastPing: function() { throw Error("Not implemented"); },
|
||||||
getLastest: function() { throw Error("Not implemented"); },
|
getLastest: function() { throw Error("Not implemented"); },
|
||||||
|
log: function() {},
|
||||||
|
increment: function() {}
|
||||||
|
},
|
||||||
|
"error.logger": {
|
||||||
|
log: function() {},
|
||||||
},
|
},
|
||||||
error_handler: {reportError: function(){}},
|
error_handler: {reportError: function(){}},
|
||||||
proc: {
|
proc: {
|
||||||
|
|
Ładowanie…
Reference in New Issue