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

Commit 98cd40a2 by Mick Hansen Committed by Jan Aagaard Meier

picking

1 parent 80963ff6
...@@ -92,6 +92,7 @@ module.exports = (function() { ...@@ -92,6 +92,7 @@ module.exports = (function() {
} }
DAOFactory.prototype.findAll = function(options) { DAOFactory.prototype.findAll = function(options) {
var start = tk.time();
if ((typeof options === 'object') && (options.hasOwnProperty('include'))) { if ((typeof options === 'object') && (options.hasOwnProperty('include'))) {
var includes = options.include var includes = options.include
...@@ -102,6 +103,7 @@ module.exports = (function() { ...@@ -102,6 +103,7 @@ module.exports = (function() {
}.bind(this)) }.bind(this))
} }
this.daoFactoryManager.sequelize._metric('Model.findAll', tk.time() - start);
return this.QueryInterface.select(this, this.tableName, options) return this.QueryInterface.select(this, this.tableName, options)
} }
......
...@@ -71,6 +71,7 @@ module.exports = (function() { ...@@ -71,6 +71,7 @@ module.exports = (function() {
result = data result = data
} }
this.sequelize._metric("AbstractQuery.formatResults", tk.time() - start);
return result return result
} }
...@@ -138,12 +139,7 @@ module.exports = (function() { ...@@ -138,12 +139,7 @@ module.exports = (function() {
if (!!tableName) { if (!!tableName) {
return return
} else { } else {
var regExp = new RegExp("^" + daoFactory.tableName + "\\.") if (attribute.indexOf(daoFactory.tableName+".") === 0) tableName = daoFactory.tableName;
, match = attribute.match(regExp)
if (!!match) {
tableName = daoFactory.tableName
}
} }
}) })
...@@ -211,7 +207,8 @@ module.exports = (function() { ...@@ -211,7 +207,8 @@ module.exports = (function() {
} }
var handleSelectQuery = function(results) { var handleSelectQuery = function(results) {
var result = null var start = tk.time(), _start;
var result = null, self = this;
if (this.options.raw) { if (this.options.raw) {
result = results result = results
...@@ -241,6 +238,7 @@ module.exports = (function() { ...@@ -241,6 +238,7 @@ module.exports = (function() {
result = (result.length === 0) ? null : result[0] result = (result.length === 0) ? null : result[0]
} }
this.sequelize._metric("handleSelectQuery", tk.time() - start);
return result return result
} }
......
...@@ -249,6 +249,7 @@ module.exports = (function() { ...@@ -249,6 +249,7 @@ module.exports = (function() {
var queryAndEmit = function(sqlOrQueryParams, methodName, options) { var queryAndEmit = function(sqlOrQueryParams, methodName, options) {
var self = this var self = this
var start = tk.time();
options = Utils._.extend({ options = Utils._.extend({
success: function(){}, success: function(){},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!