Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi, is it possible to log out how long a individual sql has taken? #488

Closed
cmingxu opened this issue Mar 14, 2013 · 4 comments
Closed
Assignees
Labels
type: feature For issues and PRs. For new features. Never breaking changes.

Comments

@cmingxu
Copy link

cmingxu commented Mar 14, 2013

Hi, is it possible to log out how long a individual sql has taken?

@sdepold
Copy link
Member

sdepold commented Mar 14, 2013

well. it's not build in yet (but that would probably be a good idea :)), but you could do

var t = +new Date()

sequelize.query().success(function(){
console.log((+new Date()) - t)
})

Sascha Depold
Gesendet mit Sparrow (http://www.sparrowmailapp.com/?sig)

Am Donnerstag, 14. März 2013 um 04:16 schrieb kevin.xu:

Hi, is it possible to log out how long a individual sql has taken?


Reply to this email directly or view it on GitHub (#488).

@ghost ghost assigned durango May 7, 2013
@durango
Copy link
Member

durango commented Jun 25, 2013

@sdepold I was thinking of making a new sequelize option called "benchmark" if it's set to true, then instead of showing

Executing CREATE TABLE IF NOT EXISTS "UserWithDecs" ("value" DECIMAL(10,3), "id"   SERIAL , "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));

it would just show...

Executed CREATE TABLE IF NOT EXISTS "UserWithDecs" ("value" DECIMAL(10,3), "id"   SERIAL , "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id")); in 8ms

I can make it show both of course and change the overall format if you'd like :) Let me know if this is a suitable solution.

@janmeier
Copy link
Member

Sounds suitable to me. I would recommend using node-microtime

mvh.
Jan Aagaard Meier
Tlf: 30 20 13 21

On Tue, Jun 25, 2013 at 3:13 AM, Daniel Durante notifications@github.comwrote:

@sdepold https://github.com/sdepold I was thinking of making a new
sequelize option called "benchmark" if it's set to true, then instead of
showing

Executing CREATE TABLE IF NOT EXISTS "UserWithDecs" ("value" DECIMAL(10,3), "id" SERIAL , "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id"));

it would just show...

Executed CREATE TABLE IF NOT EXISTS "UserWithDecs" ("value" DECIMAL(10,3), "id" SERIAL , "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, PRIMARY KEY ("id")); in 8ms

I can make it show both of course and change the overall format if you'd
like :) Let me know if this is a suitable solution.


Reply to this email directly or view it on GitHubhttps://github.com//issues/488#issuecomment-19947168
.

@durango
Copy link
Member

durango commented Jun 25, 2013

I was trying to avoid another dependency tbh, if no one minds I can throw it in :)

mickhansen added a commit that referenced this issue Jan 6, 2016
Feature #488 : Added benchmarking support in query logs
mickhansen added a commit that referenced this issue Jan 6, 2016
Revert "Feature #488 : Added benchmarking support in query logs"
mickhansen added a commit that referenced this issue Jan 6, 2016
Feat #488 : Benchmarks based on the pure JS Date.now()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature For issues and PRs. For new features. Never breaking changes.
Projects
None yet
Development

No branches or pull requests

4 participants