blob: 7957a22dc6bb6462872d4d661cbb23c9c5429642 [file] [log] [blame]
<?php
/********************************************************************************
* Copyright (c) 2018 The Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
require_once dirname ( __FILE__ ) . '/../charts.inc';
function chart_ip_velocity($context) {
return ChartBuilder::named ( 'ip_velocity' )
->title ( "Average IP Team Velocity Over Time (:start to :end)" )
->description ( "This is the average number of non-trival CQs (e.g. not piggybacks)
resolved by the IP Team, per day in any given month." )
->query ('ipzilla', "
select
date_format(ba.bug_when, '%Y-%m') as period,
(count(distinct ba.bug_id) / count(distinct date(ba.bug_when))) as velocity
from bugs_activity as ba
join bugs as b on ba.bug_id=b.bug_id
join components as c on b.component_id=c.id
where
added='RESOLVED'
and ba.bug_when between date(':start') and date(':end')
and b.short_desc not regexp '\((PB( Orbit)?)\s*\d*\)'
and b.short_desc not regexp '\(ATO\s*\d*\)'
and b.cf_type not in ('Type_A')
and c.name not in ('IP_Discussion')
group by date_format(ba.bug_when, '%Y-%m')
" )
->substitute ( ':start', $context->getStart()->format('Y-m-d') )
->substitute ( ':end', $context->getEnd()->format('Y-m-d') )
->column ( 'Month', 'period', 'string', 'asYearMonth' )
->column ( 'CQs Resolved per Day', 'velocity', 'number' );
}
?>