@oino-ts/db-mariadb 0.20.1 → 0.21.0

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.
@@ -292,7 +292,8 @@ class OINODbMariadb extends db_1.OINODb {
292
292
  await connection.release();
293
293
  }
294
294
  }
295
- return Promise.resolve(result);
295
+ common_1.OINOBenchmark.endMetric("OINODb", "connect", result.status != 500);
296
+ return result;
296
297
  }
297
298
  /**
298
299
  * Validate connection to database is working.
@@ -321,7 +322,7 @@ class OINODbMariadb extends db_1.OINODb {
321
322
  result.setError(500, "Exception validating connection: " + e.message, "OINODbMariadb.validate");
322
323
  common_1.OINOLog.exception("@oino-ts/db-mariadb", "OINODbMariadb", "validate", "exception in validate", { message: e.message, stack: e.stack });
323
324
  }
324
- common_1.OINOBenchmark.endMetric("OINODb", "validate");
325
+ common_1.OINOBenchmark.endMetric("OINODb", "validate", result.status != 500);
325
326
  return result;
326
327
  }
327
328
  /**
@@ -347,7 +348,7 @@ class OINODbMariadb extends db_1.OINODb {
347
348
  }
348
349
  common_1.OINOBenchmark.startMetric("OINODb", "sqlSelect");
349
350
  let result = await this._query(sql);
350
- common_1.OINOBenchmark.endMetric("OINODb", "sqlSelect");
351
+ common_1.OINOBenchmark.endMetric("OINODb", "sqlSelect", result.status != 500);
351
352
  return result;
352
353
  }
353
354
  /**
@@ -289,7 +289,8 @@ export class OINODbMariadb extends OINODb {
289
289
  await connection.release();
290
290
  }
291
291
  }
292
- return Promise.resolve(result);
292
+ OINOBenchmark.endMetric("OINODb", "connect", result.status != 500);
293
+ return result;
293
294
  }
294
295
  /**
295
296
  * Validate connection to database is working.
@@ -318,7 +319,7 @@ export class OINODbMariadb extends OINODb {
318
319
  result.setError(500, "Exception validating connection: " + e.message, "OINODbMariadb.validate");
319
320
  OINOLog.exception("@oino-ts/db-mariadb", "OINODbMariadb", "validate", "exception in validate", { message: e.message, stack: e.stack });
320
321
  }
321
- OINOBenchmark.endMetric("OINODb", "validate");
322
+ OINOBenchmark.endMetric("OINODb", "validate", result.status != 500);
322
323
  return result;
323
324
  }
324
325
  /**
@@ -344,7 +345,7 @@ export class OINODbMariadb extends OINODb {
344
345
  }
345
346
  OINOBenchmark.startMetric("OINODb", "sqlSelect");
346
347
  let result = await this._query(sql);
347
- OINOBenchmark.endMetric("OINODb", "sqlSelect");
348
+ OINOBenchmark.endMetric("OINODb", "sqlSelect", result.status != 500);
348
349
  return result;
349
350
  }
350
351
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/db-mariadb",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "OINO TS package for using Mariadb databases.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -21,8 +21,8 @@
21
21
  "module": "./dist/esm/index.js",
22
22
  "types": "./dist/types/index.d.ts",
23
23
  "dependencies": {
24
- "@oino-ts/common": "^0.20.1",
25
- "@oino-ts/db": "^0.20.1",
24
+ "@oino-ts/common": "^0.21.0",
25
+ "@oino-ts/db": "^0.21.0",
26
26
  "mariadb": "^3.2.3"
27
27
  },
28
28
  "devDependencies": {
@@ -308,7 +308,8 @@ export class OINODbMariadb extends OINODb {
308
308
  }
309
309
  }
310
310
 
311
- return Promise.resolve(result)
311
+ OINOBenchmark.endMetric("OINODb", "connect", result.status != 500)
312
+ return result
312
313
  }
313
314
 
314
315
  /**
@@ -337,7 +338,7 @@ export class OINODbMariadb extends OINODb {
337
338
  result.setError(500, "Exception validating connection: " + e.message, "OINODbMariadb.validate")
338
339
  OINOLog.exception("@oino-ts/db-mariadb", "OINODbMariadb", "validate", "exception in validate", {message:e.message, stack:e.stack})
339
340
  }
340
- OINOBenchmark.endMetric("OINODb", "validate")
341
+ OINOBenchmark.endMetric("OINODb", "validate", result.status != 500)
341
342
  return result
342
343
  }
343
344
 
@@ -365,7 +366,7 @@ export class OINODbMariadb extends OINODb {
365
366
  }
366
367
  OINOBenchmark.startMetric("OINODb", "sqlSelect")
367
368
  let result:OINODbDataSet = await this._query(sql)
368
- OINOBenchmark.endMetric("OINODb", "sqlSelect")
369
+ OINOBenchmark.endMetric("OINODb", "sqlSelect", result.status != 500)
369
370
  return result
370
371
  }
371
372