We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22629
    • 194 Posts
    Do the "timing" tags exist in Revolution?

    I’m looking for the Revo version of the following Evo tags:

    [^qt^] - Query Time - Shows how long MODx took talking to the database
    [^q^] - Query Count -Shows how many database queries MODx made
    [^p^] - Parse Time - Shows how long MODx took to parse the page
    [^t^] - Total Time - Shows the total time taken to parse/ render the page
    [^s^] - Source - Shows the source of page, whether is database or cache.

    I tried [[^qt]] etc but it doesn’t output anything.

    Thanks.
      Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

      modx Revolution 2.2.6
      Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

      Content-Managed Websites Built on MODX
      • 22629
      • 194 Posts
      Oops never mind - the tags are still the same; they don’t appear to have been converted to the Revo tag format.
        Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

        modx Revolution 2.2.6
        Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

        Content-Managed Websites Built on MODX
        • 19534
        • 183 Posts
        Do they work properly in Revolution?

        I always get the following output:

        0.0000 s - Query Time - Shows how long MODx took talking to the database
        0 - Query Count -Shows how many database queries MODx made
        x s - Parse Time - Shows how long MODx took to parse the page
        x s - Total Time - Shows the total time taken to parse/ render the page
        database - Source - Shows the source of page, whether is database or cache.

        Parse and Total Time are always equal. Query Count and Query Time are always 0 (even after clearing the cache?!?) and Source is always "database" although I use caching.

        It’s very important for me to find the performance bottleneck. Because our (very simple) MODx site is very slow and I need to know why to be able to complain to our hosting provider.
          Add-On to easily manage your multilingual sites: Babel
          • 22629
          • 194 Posts
          Quote from: Jakob at Nov 17, 2010, 11:45 AM

          Do they work properly in Revolution?

          They do indeed work fine for me in Revo 2.0.4-pl2. I haven’t got access to my system at the moment so I can’t give you a sample, but it’s something like this in my template:

          <!-- modx - database: [^qt^], [^q^] queries, application: [^p^], total: [^t^], source: [^s^] -->

          which outputs something like:

          <!-- modx - database: 0.384s, 18 queries, application: 0.409s, total: 0.793s, source: database -->

          or after caching:

          <!-- modx - database: 0.000s, 0 queries, application: 0.301s, total: 0.301s, source: cache -->

          Incidentally I did spot on the tracker that a future version of modx will convert these tags to the Revo format.
            Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

            modx Revolution 2.2.6
            Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

            Content-Managed Websites Built on MODX
          • They sort of work, but the database query count and time is wrong; the problem is that not every query in Revolution goes through a mechanism where the query time can be calculated. In fact, most of them cannot be traced the way the DBAPI did for various reasons. This may be addressed in the future, but for now, you’ll have to live with inaccurate results for the db queries.
              • 22629
              • 194 Posts
              Quote from: OpenGeek at Nov 25, 2010, 03:14 PM

              They sort of work, but the database query count and time is wrong; the problem is that not every query in Revolution goes through a mechanism where the query time can be calculated. In fact, most of them cannot be traced the way the DBAPI did for various reasons. This may be addressed in the future, but for now, you’ll have to live with inaccurate results for the db queries.

              Thanks Jason. I must say, I did wonder, particularly as I have some uncached snippets which do call the database and these queries aren’t reported on a cached page (the chunk that hosts the timing tags is also called uncached, as it recognises the switch between cache/database.)
                Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                modx Revolution 2.2.6
                Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                Content-Managed Websites Built on MODX
                • 15083
                • 697 Posts
                Quote from: OpenGeek at Nov 25, 2010, 03:14 PM

                They sort of work, but the database query count and time is wrong; the problem is that not every query in Revolution goes through a mechanism where the query time can be calculated. In fact, most of them cannot be traced the way the DBAPI did for various reasons. This may be addressed in the future, but for now, you’ll have to live with inaccurate results for the db queries.

                Is there any update on this?
                Knowing the number of queries and the times etc would be very useful for debug info.
                • Quote from: jusmeig at Apr 05, 2011, 02:59 PM

                  Quote from: OpenGeek at Nov 25, 2010, 03:14 PM

                  They sort of work, but the database query count and time is wrong; the problem is that not every query in Revolution goes through a mechanism where the query time can be calculated. In fact, most of them cannot be traced the way the DBAPI did for various reasons. This may be addressed in the future, but for now, you’ll have to live with inaccurate results for the db queries.

                  Is there any update on this?
                  Knowing the number of queries and the times etc would be very useful for debug info.
                  No, unfortunately there is no way to intercept all possible queries without creating significant overhead, at least not that I have found yet. Use a Snippet solution like Executioner and/or MODX logging to capture information on how long specific queries are taking during development.
                    • 12410
                    • 353 Posts
                    Hi,
                    My home page is generating 250 queries if this is reliable?

                    <meta name="generator" content="Query time: 0.0219 s (250 Queries) // Parse time: 0.5730 s // Total time: 0.5949 s // Source: cache">


                    I'm using Migx and getResources.
                    Does this look right? I have about 230 more queries than i should have. I use [[include? &file=`assets/templates/index.php`]] to call my template if it matters?
                    How can i lower the queries. is there some cache feature I'm missing?

                    Running an apache bench test returns good times?

                    Server Software:        Apache/2.4.7
                    Server Hostname:        www.*****.com
                    Server Port:            80
                    
                    Document Path:          /
                    Document Length:        461 bytes
                    
                    Concurrency Level:      100
                    Time taken for tests:   5.362 seconds
                    Complete requests:      10000
                    Failed requests:        0
                    Non-2xx responses:      10000
                    Total transferred:      6920000 bytes
                    HTML transferred:       4610000 bytes
                    Requests per second:    1865.10 [#/sec] (mean)
                    Time per request:       53.616 [ms] (mean)
                    Time per request:       0.536 [ms] (mean, across all concurrent requests)
                    Transfer rate:          1260.40 [Kbytes/sec] received
                    
                    Connection Times (ms)
                                  min  mean[+/-sd] median   max
                    Connect:        8    8   0.3      8      16
                    Processing:     9   45  17.9     44      91
                    Waiting:        8   45  17.9     44      91
                    Total:         17   53  17.9     52      99
                    
                    Percentage of the requests served within a certain time (ms)
                      50%     52
                      66%     63
                      75%     65
                      80%     74
                      90%     76
                      95%     84
                      98%     86
                      99%     89
                     100%     99 (longest request)



                    Thanks
                      • 3749
                      • 24,544 Posts
                      If your getResources calls include TVs, that can add significantly to the number of queries, especially if the TVs have @ bindings or hold the default value because GR needs to make at least one more query for each TV for each resource. Even if the TVs don't contain those values, just having TVs in the mix can make for additional queries.

                      I have a blog post coming out in a day or so on why this is the case and offering a possible solution.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting