3
\$\begingroup\$

I am trying to give show a UI friendly dump of the cache status

<h1>Cache Status</h1>

<table class="tables dataTables">
<tr>
  <th>Cache</th>
  <th style="text-align : center;">Created Time</th>
  <th style="text-align : center;">Last Updated</th>
  <th style="text-align : center;">Last Hit</th>
  <th style="text-align : right;">Hit Count</th>
  <th style="text-align : right;">Hit Count %</th>
  <th style="text-align : right;">Size</th>
</tr>

<cfoutput>
  <cfloop index="cache" array="#cacheGetAllIds()#">
    <cfset metaData = cacheGetMetadata(cache)>
    <tr>
      <td>#cache#</td>
      <td style="text-align : center;">#LSTimeFormat(metadata.createdTime, "h:mm:ss")#</td>
      <td style="text-align : center;">#LSTimeFormat(metadata.lastHit, "h:mm:ss")#</td>
      <td style="text-align : center;">#LSTimeFormat(metadata.lastupdated, "h:mm:ss")#</td>
      <td style="text-align : right;">#metadata.hitcount#</td>
      <td style="text-align : right;"><cfset percent_of_hits = 100.0 * metadata.hitcount / metadata.cache_hitcount>
        #LSNumberFormat(percent_of_hits, '999.9')# %
      </td>
      <td style="text-align : right;">#LSNumberFormat(metadata.size)#</td>
    </tr>
  </cfloop>
</cfoutput> 
</table>

Bootstrap and Datatables formatting is applied. And it looks like this:

enter image description here

I want to make sure this is a good format and that I am not missing any easy to get at useful information

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

You have the column definitions backwards. On your header row you have:

Last Updated | Last Hit

but in the actual cf it looks like it's displaying in this order

Last Hit | Last Updated

Other than that it looks great!

\$\endgroup\$
1
  • \$\begingroup\$ I also found a divide by zero error. \$\endgroup\$ Commented Oct 9, 2015 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.