不要怂,就是干,撸起袖子干!

Commit 236b0e76 by Mick Hansen Committed by Jan Aagaard Meier

metrics

1 parent d238a052
......@@ -176,7 +176,6 @@ module.exports = (function() {
var start = tk.time();
var instance = new DAO(values, Utils._.extend(this.options, this.attributes, { hasPrimaryKeys: this.hasPrimaryKeys }))
, self = this
this.daoFactoryManager.sequelize._metric('Model.build -> new DAO', tk.time() - start);
options = options || {}
instance.__factory = this
......@@ -213,6 +212,7 @@ module.exports = (function() {
instance.isNewRecord = options.hasOwnProperty('isNewRecord') ? options.isNewRecord : true
instance.selectedValues = values
this.daoFactoryManager.sequelize._metric('Model.build', tk.time() - start);
return instance
}
......
......@@ -16,8 +16,9 @@ module.exports = (function() {
}
Utils.inherit(Query, AbstractQuery)
var tk = require('timekit');
Query.prototype.run = function(sql) {
var start = tk.time();
this.sql = sql
if(this.options.logging !== false) {
......@@ -26,7 +27,7 @@ module.exports = (function() {
this.client.query(this.sql, function(err, results, fields) {
this.emit('sql', this.sql)
this.sequelize._metric('SQL', tk.time() - start);
if (err) {
this.emit('error', err, this.callee)
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!