You are here

public function DatabaseDataCollector::getColorCode in Devel 8

Same name and namespace in other branches
  1. 8.3 webprofiler/src/DataCollector/DatabaseDataCollector.php \Drupal\webprofiler\DataCollector\DatabaseDataCollector::getColorCode()
  2. 8.2 webprofiler/src/DataCollector/DatabaseDataCollector.php \Drupal\webprofiler\DataCollector\DatabaseDataCollector::getColorCode()
  3. 4.x webprofiler/src/DataCollector/DatabaseDataCollector.php \Drupal\webprofiler\DataCollector\DatabaseDataCollector::getColorCode()

Returns a color based on the number of executed queries.

Return value

string

File

webprofiler/src/DataCollector/DatabaseDataCollector.php, line 140

Class

DatabaseDataCollector
Class DatabaseDataCollector

Namespace

Drupal\webprofiler\DataCollector

Code

public function getColorCode() {
  if ($this
    ->getQueryCount() < 100) {
    return 'green';
  }
  if ($this
    ->getQueryCount() < 200) {
    return 'yellow';
  }
  return 'red';
}