} } // Get the beginning and end of our relevant date rate. $beginning_timestamp = $currentstarttime - ($date_range - 1) * 3600 * 24; $end_timestamp = $currentstarttime + 3600 * 24; $start_date = gmdate(FMT_DATETIME, $beginning_timestamp); $end_date = gmdate(FMT_DATETIME, $end_timestamp); // Perform a query to get info about all of our builds that fall within this // time range. $builds_query = "SELECT b.id,\n b.builderrors AS build_errors,\n b.buildwarnings AS build_warnings,\n b.testfailed AS failing_tests,\n b.configureerrors AS configure_errors,\n b.configurewarnings AS configure_warnings, b.starttime,\n cs.loctested AS loctested, cs.locuntested AS locuntested,\n b2g.groupid AS groupid\n FROM build AS b\n LEFT JOIN build2group AS b2g ON (b2g.buildid=b.id)\n LEFT JOIN coveragesummary AS cs ON (cs.buildid=b.id)\n WHERE b.projectid = '{$projectid}'\n AND b.starttime BETWEEN '{$start_date}' AND '{$end_date}'\n AND b.parentid IN (-1, 0)"; $builds_array = pdo_query($builds_query); add_last_sql_error("gather_overview_data"); while ($build_row = pdo_fetch_array($builds_array)) { // get what day this build is for. $day = get_day_index($build_row["starttime"]); $static_name = get_static_group_name($build_row["groupid"]); // Special handling for static builds, as we don't need to record as // much data about them. if ($static_name) { foreach ($static_measurements as $measurement) { if (!array_key_exists($measurement, $overview_data[$day][$static_name])) { $overview_data[$day][$static_name][$measurement] = intval($build_row["build_{$measurement}"]); } else { $overview_data[$day][$static_name][$measurement] += $build_row["build_{$measurement}"]; } // Don't let our measurements be thrown off by CDash's tendency // to store -1s in the database. $overview_data[$day][$static_name][$measurement] = max(0, $overview_data[$day][$static_name][$measurement]); } continue; }
// Perform a query to get info about all of our builds that fall within this // time range. $builds_query = "SELECT b.id, b.type, b.name,\n b.builderrors AS build_errors,\n b.buildwarnings AS build_warnings,\n b.testfailed AS failing_tests,\n b.configureerrors AS configure_errors,\n b.configurewarnings AS configure_warnings, b.starttime,\n cs.loctested AS loctested, cs.locuntested AS locuntested,\n das.checker AS checker, das.numdefects AS numdefects,\n b2g.groupid AS groupid\n FROM build AS b\n LEFT JOIN build2group AS b2g ON (b2g.buildid=b.id)\n LEFT JOIN coveragesummary AS cs ON (cs.buildid=b.id)\n LEFT JOIN dynamicanalysissummary AS das ON (das.buildid=b.id)\n WHERE b.projectid = '{$projectid}'\n AND b.starttime BETWEEN '{$start_date}' AND '{$end_date}'\n AND b.parentid IN (-1, 0)"; $builds_array = pdo_query($builds_query); add_last_sql_error('gather_overview_data'); // If we have multiple coverage builds in a single day we will also // show the aggregate. $aggregate_tracker = array(); $show_aggregate = false; // Keep track of the different types of dynamic analysis that are being // performed on our build groups of interest. $dynamic_analysis_types = array(); while ($build_row = pdo_fetch_array($builds_array)) { // get what day this build is for. $day = get_day_index($build_row['starttime']); $static_name = get_static_group_name($build_row['groupid']); // Special handling for static builds, as we don't need to record as // much data about them. if ($static_name) { foreach ($static_measurements as $measurement) { if (!array_key_exists($measurement, $overview_data[$day][$static_name])) { $overview_data[$day][$static_name][$measurement] = intval($build_row["build_{$measurement}"]); } else { $overview_data[$day][$static_name][$measurement] += $build_row["build_{$measurement}"]; } // Don't let our measurements be thrown off by CDash's tendency // to store -1s in the database. $overview_data[$day][$static_name][$measurement] = max(0, $overview_data[$day][$static_name][$measurement]); } continue; }