logitude-dashboard-library 3.1.114 → 3.1.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,8 @@ export declare class WidgetLoadLogger {
|
|
|
5
5
|
private Widget;
|
|
6
6
|
constructor(widget: ReactWidgetPM, isPreviewMode: boolean | null | undefined);
|
|
7
7
|
log(loadDataResponse: AxiosResponse<any, any>): void;
|
|
8
|
+
private canCreateLog;
|
|
8
9
|
private getLoadTime;
|
|
9
10
|
private isNumber;
|
|
11
|
+
private isClickHouse;
|
|
10
12
|
}
|
package/dist/index.js
CHANGED
|
@@ -980,7 +980,7 @@ var WidgetLoadLogger = /*#__PURE__*/function () {
|
|
|
980
980
|
var _proto = WidgetLoadLogger.prototype;
|
|
981
981
|
|
|
982
982
|
_proto.log = function log(loadDataResponse) {
|
|
983
|
-
if (this.
|
|
983
|
+
if (this.canCreateLog(loadDataResponse)) {
|
|
984
984
|
var totalExecutionTime = new Date().getTime() - this.StartTime;
|
|
985
985
|
var widgetLoadLogService = new WidgetLoadLogService();
|
|
986
986
|
var widgetLoadLog = {
|
|
@@ -988,7 +988,8 @@ var WidgetLoadLogger = /*#__PURE__*/function () {
|
|
|
988
988
|
WidgetId: this.Widget.Id,
|
|
989
989
|
DashboardId: this.Widget.DashboardId,
|
|
990
990
|
LoadTime: this.getLoadTime(loadDataResponse),
|
|
991
|
-
TotalExecutionTime: totalExecutionTime
|
|
991
|
+
TotalExecutionTime: totalExecutionTime,
|
|
992
|
+
IsClickHouse: this.isClickHouse(loadDataResponse)
|
|
992
993
|
};
|
|
993
994
|
widgetLoadLogService.create(widgetLoadLog).then(function (_response) {}, function (_error) {});
|
|
994
995
|
}
|
|
@@ -997,6 +998,10 @@ var WidgetLoadLogger = /*#__PURE__*/function () {
|
|
|
997
998
|
this.Widget = null;
|
|
998
999
|
};
|
|
999
1000
|
|
|
1001
|
+
_proto.canCreateLog = function canCreateLog(loadDataResponse) {
|
|
1002
|
+
return this.StartTime !== null && this.StartTime !== undefined && this.Widget !== null && this.Widget !== undefined && this.Widget.Id !== null && this.Widget.Id !== undefined && this.Widget.Id !== "" && this.Widget.DashboardId !== null && this.Widget.DashboardId !== undefined && this.Widget.DashboardId !== "" && this.Widget.Tenant !== null && this.Widget.Tenant !== undefined && loadDataResponse !== null && loadDataResponse !== undefined;
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1000
1005
|
_proto.getLoadTime = function getLoadTime(loadDataResponse) {
|
|
1001
1006
|
var loadTimeHeaderKey = "load-time";
|
|
1002
1007
|
var loadTimeHeader = loadDataResponse && loadDataResponse.headers && loadDataResponse.headers[loadTimeHeaderKey] ? loadDataResponse.headers[loadTimeHeaderKey] : "";
|
|
@@ -1007,6 +1012,12 @@ var WidgetLoadLogger = /*#__PURE__*/function () {
|
|
|
1007
1012
|
return value !== null && value !== undefined && value !== "" && !isNaN(Number(value.toString()));
|
|
1008
1013
|
};
|
|
1009
1014
|
|
|
1015
|
+
_proto.isClickHouse = function isClickHouse(loadDataResponse) {
|
|
1016
|
+
var clickHouseHeaderKey = "click-house";
|
|
1017
|
+
var clickHouseHeader = loadDataResponse && loadDataResponse.headers && loadDataResponse.headers[clickHouseHeaderKey] ? loadDataResponse.headers[clickHouseHeaderKey] : null;
|
|
1018
|
+
return clickHouseHeader === "true";
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1010
1021
|
return WidgetLoadLogger;
|
|
1011
1022
|
}();
|
|
1012
1023
|
|