mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
Dev: improved performance measure tooling
SVN:trunk[1144]
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
<?php
|
||||
define('APPROOT', dirname(__FILE__).'/');
|
||||
if (function_exists('microtime'))
|
||||
{
|
||||
$fItopStarted = microtime(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$fItopStarted = 1000 * time();
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -193,4 +193,13 @@ class ExecutionKPI
|
||||
}
|
||||
}
|
||||
|
||||
class ApplicationStartupKPI extends ExecutionKPI
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $fItopStarted;
|
||||
$this->m_fStarted = $fItopStarted;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -456,6 +456,9 @@ try
|
||||
require_once(APPROOT.'/application/startup.inc.php');
|
||||
$operation = utils::ReadParam('operation', '');
|
||||
|
||||
$oKPI = new ApplicationStartupKPI();
|
||||
$oKPI->ComputeAndReport('Load of data model and all includes');
|
||||
|
||||
$oKPI = new ExecutionKPI();
|
||||
|
||||
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
|
||||
|
||||
@@ -143,6 +143,13 @@ class BenchmarkDataCreation
|
||||
$oMyObject = MetaModel::NewObject($sClass);
|
||||
foreach($aData as $sProp => $value)
|
||||
{
|
||||
if (is_array($value))
|
||||
{
|
||||
// transform into a link set
|
||||
$sCSVSpec = implode('|', $value);
|
||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sProp);
|
||||
$value = $oAttDef->MakeValueFromString($sCSVSpec, $sSepItem = '|', $sSepAttribute = ';', $sSepValue = ':', $sAttributeQualifier = '"');
|
||||
}
|
||||
$oMyObject->Set($sProp, $value);
|
||||
}
|
||||
|
||||
@@ -295,18 +302,10 @@ class BenchmarkDataCreation
|
||||
'login' => 'guru',
|
||||
'password' => 'guru',
|
||||
'language' => 'EN US',
|
||||
'profile_list' => array("profileid:$iGuruProfile;reason:he is the one"),
|
||||
);
|
||||
$iLogin = $this->CreateObject('UserLocal', $aData);
|
||||
|
||||
// Assign the guru profile to the new login
|
||||
//
|
||||
$aData = array(
|
||||
'userid' => $iLogin,
|
||||
'profileid' => $iGuruProfile,
|
||||
'reason' => 'he is the one',
|
||||
);
|
||||
$this->CreateObject('URP_UserProfile', $aData);
|
||||
|
||||
////////////////////////////////////////
|
||||
// User login having all std profiles
|
||||
//
|
||||
@@ -318,26 +317,21 @@ class BenchmarkDataCreation
|
||||
'email' => 'foo@combodo.com',
|
||||
);
|
||||
$iPerson = $this->CreateObject('Person', $aData);
|
||||
|
||||
$aProfileSet = array();
|
||||
foreach($aStdProfiles as $iProfileId)
|
||||
{
|
||||
$aProfileSet[] = "profileid:$iProfileId;reason:xxx";
|
||||
}
|
||||
$aData = array(
|
||||
'contactid' => $iPerson,
|
||||
'login' => 'foo',
|
||||
'password' => 'foo',
|
||||
'language' => 'EN US',
|
||||
'profile_list' => $aProfileSet,
|
||||
);
|
||||
$iLogin = $this->CreateObject('UserLocal', $aData);
|
||||
|
||||
// Assign profiles to the new login
|
||||
//
|
||||
foreach($aStdProfiles as $iProfileId)
|
||||
{
|
||||
$aData = array(
|
||||
'userid' => $iLogin,
|
||||
'profileid' => $iProfileId,
|
||||
'reason' => '',
|
||||
);
|
||||
$this->CreateObject('URP_UserProfile', $aData);
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
//
|
||||
// Organizations
|
||||
|
||||
Reference in New Issue
Block a user