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

Improved queries counting #75

Merged
merged 3 commits into from
Oct 28, 2015
Merged

Improved queries counting #75

merged 3 commits into from
Oct 28, 2015

Conversation

Xymanek
Copy link
Contributor

@Xymanek Xymanek commented Aug 6, 2015

I've added a new way of counting queries. The differences are as follows

  • $this->num_queries now holds amount of queries that were run since object's creation
  • $this->conn_queries now holds amount of queries that were run since the last time object connected to DB (it is reset every time the $this->disconnect() and $this->connect() functions are called)
  • A new function $this->count() has been added with 2 arguments:
    1. Controls whether the function should return total number of queries (default) or only since last connect
    2. Set to true to increase the query count (internal usage)

This change also fixes #72

P.S. While making changes I've found that not every class implements $this->disconnect(). Is this supposed to be so?

@fawaf
Copy link
Member

fawaf commented Aug 19, 2015

good question. @jv2222 could you answer that?

@fawaf
Copy link
Member

fawaf commented Aug 25, 2015

i would think that $this->disconnect() not implemented everywhere is an oversight, but i want to confirm with @jv2222 since he is the original author of the code.

also, cc @ozh

fawaf added a commit that referenced this pull request Oct 28, 2015
Improved queries counting
@fawaf fawaf merged commit 6373478 into ezSQL:master Oct 28, 2015
@jv2222
Copy link
Contributor

jv2222 commented Oct 28, 2015

Thanks All.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After 500 queries script reconnects after each query
3 participants