Example #1
0
void IvBox::updateStats()
{
    blockSignals(true);
    for(int i = 0; i < 6; i++) {
        updateStat(i);
    }
    blockSignals(false);
    emit statsUpdated();
}
Example #2
0
void Tracker::printStat(ostream & xout){
	printOCsOverviewTitled(xout);
	updateStat();
	xout<<"\nOverall caled flit num = "<< flit_recved << endl;
	xout<<"\nOverall total flit latency = "<< total_latency << endl;
	xout <<"\nOverall average flit latency (in clock cycles per flit) = "<< avg_latency << endl;

	xout <<"\nOverall average flit throughput (Gbps) = "<< avg_throughput << endl;
}
Example #3
0
// Record function end time into context->endTime and
// print the duration of function execution
void record_end_time(void * context)
{
    struct WrappingContext * cont = (struct WrappingContext *)context;
    printf("ELFPERF_DEBUG: record_end_time for context: %x\n", context);
 
    cont->endTime = getRdtscTicks();

    uint64_t duration = cont->endTime - cont->startTime;
    printf("Function duration = %llu ticks\n", duration);

    // Updating statistic for function
    updateStat(cont->functionPointer - FCN_PTR_OFFSET, duration);
    //errno = 0;
}
void			AObject::updateMap(std::pair<int, int> curPos, std::pair<int, int> newPos)
{
  newPos.first = curPos.first + newPos.first;
  newPos.second = curPos.second + newPos.second;
  for (std::vector<AObject *>::iterator it = _bomb.begin(); it != _bomb.end(); ++it)
    getMap()->setBox((*it)->getPos(), Map::BOMB);
  if (getMap()->getMap()[newPos] == Map::EMPTY || getMap()->getMap()[newPos] == Map::RANGE
      || getMap()->getMap()[newPos] == Map::SIMULT || getMap()->getMap()[newPos] == Map::SPEED)
    {
      if (getMap()->getMap()[newPos] != Map::EMPTY)
	updateStat(getMap()->getMap()[newPos]);
      setPos(newPos);
      getMap()->setBox(newPos, getMapEnum());
      getMap()->setBox(curPos, Map::EMPTY);
      _time = 0;
    }
}
Example #5
0
EQStatList::EQStatList(EQPlayer* player,
                       QWidget* parent, 
                       const char* name)
  : SEQListView("StatList", parent, name),
    m_pPlayer(player)
{
   int i;

   m_guessMaxMana = 0;

   for (i = 0; i < LIST_MAXLIST; i++)
     m_statList[i] = NULL;

   // add columns
   addColumn("Stat");
   addColumn("Val", "Value");
   addColumn("Max");
   addColumn("%", "Percent");

   restoreColumns();

   QString statPrefName;
   for (int nloop = 0; nloop < LIST_MAXLIST; nloop++)
   {
     statPrefName.sprintf("show%s", statNames[nloop]);
     m_showStat[nloop] = pSEQPrefs->getPrefBool(statPrefName, 
						preferenceName(), false);
     updateStat(nloop);
   }

   connect (m_pPlayer, SIGNAL(statChanged(int,int,int)), 
	    this, SLOT(statChanged (int,int,int)));
   connect (m_pPlayer, SIGNAL(expChangedInt(int,int,int)),
	    this, SLOT(expChanged(int,int,int)));
   connect (m_pPlayer, SIGNAL(expAltChangedInt(int,int,int)),
	    this, SLOT(expAltChanged(int,int,int)));
   connect (m_pPlayer, SIGNAL(stamChanged(int,int,int,int,int,int)),
	    this, SLOT(stamChanged(int,int,int,int,int,int)));
   connect (m_pPlayer, SIGNAL(manaChanged(uint32_t,uint32_t)),
	    this, SLOT(manaChanged(uint32_t,uint32_t)));
   connect (m_pPlayer, SIGNAL(hpChanged(uint16_t, uint16_t)), 
	    this, SLOT(hpChanged(uint16_t, uint16_t)));

   // restore the columns
   restoreColumns();
}
Example #6
0
void BaseContestLog::updateStats( void )
{
   QSO1 = 0;
   kms1 = 0;
   mults1 = 0;
   QSO2 = 0;
   kms2 = 0;
   mults2 = 0;
   QSO1p = 0;
   kms1p = 0;
   mults1p = 0;
   QSO2p = 0;
   kms2p = 0;
   mults2p = 0;
   for ( int i = getContactCount() - 1; i >= 0; i-- )
   {
      if ( !updateStat( ctList[ i ] ) )
         break;
   }
}
Example #7
0
void Tracker::printStat(ostream & xout){
	updateStat();

	xout << "## Overall Statistical Data " << endl;
	xout << "Stat. starts at " << gc_statOp << " cycles, ends at " 
		<< (g_simCount>gc_statEd?gc_statEd:g_simCount) << " cycles." << endl;
	xout << "Overall flits input num = " << flits_send << endl;
	xout << "Overall flits output num = " << flits_recved << endl;
	xout << "Overall average flit delay within a tile (in clock cycles per flit) = " << avg_flit_swDelay << endl;
	xout << "Overall average flit latency (in clock cycles per flit) = " << avg_flit_latency << endl;
	xout << "Overall average flit hops = " << avg_flit_hops << endl;
	xout << endl;
	xout << "Overall packets input num = " << pkts_send << endl;
	xout << "Overall packets output num = " << pkts_recved << endl;
	xout << "Overall average packet delay within a tile (in clock cycles per flit) = " << avg_pkt_swDelay << endl;
	xout << "Overall average packet latency (in clock cycles per flit) = " << avg_pkt_latency << endl;
	xout << endl;
	xout << "Overall average flit inputRate (Gbps) = " << avg_inputRate << endl; 
	xout << "Overall average flit outputRate (Gbps) = " << avg_outputRate << endl << endl;
	xout << "InputChannel Stat." << endl;
	printICsOverviewTitled(xout);
	xout << "OutputChannel Stat." << endl;
	printOCsOverviewTitled(xout);
}
Example #8
0
void BcmPort::updateStats() {
  // TODO: It would be nicer to use a monotonic clock, but unfortunately
  // the ServiceData code currently expects everyone to use system time.
  if (!shouldReportStats()) {
    return;
  }
  auto now = duration_cast<seconds>(system_clock::now().time_since_epoch());
  HwPortStats curPortStats;
  updateStat(
      now, kInBytes, opennsl_spl_snmpIfHCInOctets, &curPortStats.inBytes_);
  updateStat(
      now,
      kInUnicastPkts,
      opennsl_spl_snmpIfHCInUcastPkts,
      &curPortStats.inUnicastPkts_);
  updateStat(
      now,
      kInMulticastPkts,
      opennsl_spl_snmpIfHCInMulticastPkts,
      &curPortStats.inMulticastPkts_);
  updateStat(
      now,
      kInBroadcastPkts,
      opennsl_spl_snmpIfHCInBroadcastPkts,
      &curPortStats.inBroadcastPkts_);
  updateStat(
      now,
      kInDiscards,
      opennsl_spl_snmpIfInDiscards,
      &curPortStats.inDiscards_);
  updateStat(
      now, kInErrors, opennsl_spl_snmpIfInErrors, &curPortStats.inErrors_);
  updateStat(
      now,
      kInIpv4HdrErrors,
      opennsl_spl_snmpIpInHdrErrors,
      &curPortStats.inIpv4HdrErrors_);
  updateStat(
      now,
      kInIpv6HdrErrors,
      opennsl_spl_snmpIpv6IfStatsInHdrErrors,
      &curPortStats.inIpv6HdrErrors_);
  updateStat(
      now,
      kInPause,
      opennsl_spl_snmpDot3InPauseFrames,
      &curPortStats.inPause_);
  // Egress Stats
  updateStat(
      now, kOutBytes, opennsl_spl_snmpIfHCOutOctets, &curPortStats.outBytes_);
  updateStat(
      now,
      kOutUnicastPkts,
      opennsl_spl_snmpIfHCOutUcastPkts,
      &curPortStats.outUnicastPkts_);
  updateStat(
      now,
      kOutMulticastPkts,
      opennsl_spl_snmpIfHCOutMulticastPkts,
      &curPortStats.outMulticastPkts_);
  updateStat(
      now,
      kOutBroadcastPkts,
      opennsl_spl_snmpIfHCOutBroadcastPckts,
      &curPortStats.outBroadcastPkts_);
  updateStat(
      now,
      kOutDiscards,
      opennsl_spl_snmpIfOutDiscards,
      &curPortStats.outDiscards_);
  updateStat(
      now, kOutErrors, opennsl_spl_snmpIfOutErrors, &curPortStats.outErrors_);
  updateStat(
      now,
      kOutPause,
      opennsl_spl_snmpDot3OutPauseFrames,
      &curPortStats.outPause_);

  setAdditionalStats(now, &curPortStats);
  // Compute non pause discards
  const auto kUninit = hardware_stats_constants::STAT_UNINITIALIZED();
  if (isMmuLossy() && portStats_.inDiscards_ != kUninit &&
      portStats_.inPause_ != kUninit) {
    // If MMU setup as lossy, all incoming pause frames will be
    // discarded and will count towards in discards. This makes in discards
    // counter somewhat useless. So instead calculate "in_non_pause_discards",
    // as std::max(0, (inDiscardsSincePrev - inPauseSincePrev)).
    // std::max(..) is used, since stats from  h/w are synced non atomically,
    // So depending on what get synced later # of pause maybe be slightly
    // higher than # of discards.
    auto inPauseSincePrev = curPortStats.inPause_ - portStats_.inPause_;
    auto inDiscardsSincePrev =
        curPortStats.inDiscards_ - portStats_.inDiscards_;
    if (inPauseSincePrev >= 0 && inDiscardsSincePrev >=0) {
      // Account for counter rollover.
      auto inNonPauseDiscardsSincePrev =
          std::max(0L, (inDiscardsSincePrev - inPauseSincePrev));
      // Init current port stats from prev value or 0
      curPortStats.inNonPauseDiscards_ =
          (portStats_.inNonPauseDiscards_ == kUninit
               ? 0
               : portStats_.inNonPauseDiscards_);
      // Counters are cumalative
      curPortStats.inNonPauseDiscards_ += inNonPauseDiscardsSincePrev;
      auto inNonPauseDiscards = getPortCounterIf(kInNonPauseDiscards);
      inNonPauseDiscards->updateValue(now, curPortStats.inNonPauseDiscards_);
    }
  }
  portStats_ = curPortStats;

  // Update the queue length stat
  uint32_t qlength;
  auto ret = opennsl_port_queued_count_get(unit_, port_, &qlength);
  if (OPENNSL_FAILURE(ret)) {
    LOG(ERROR) << "Failed to get queue length for port " << port_
               << " :" << opennsl_errmsg(ret);
  } else {
    outQueueLen_.addValue(now.count(), qlength);
    // TODO: outQueueLen_ only exports the average queue length over the last
    // 60 seconds, 10 minutes, etc.
    // We should also export the current value.  We could use a simple counter
    // or a dynamic counter for this.
  }

  // Update the packet length histograms
  updatePktLenHist(now, &inPktLengths_, kInPktLengthStats);
  updatePktLenHist(now, &outPktLengths_, kOutPktLengthStats);
};
Example #9
0
void IvBox::updateIV(int stat)
{
    m_ivchangers[stat]->setValue(poke().DV(stat));
    updateStat(stat);
}
// insert the specified key in the Btree
// the tree needs to be opened first by the caller
RC insertKey(BTreeHandle* tree, Value* key, RID rid) {

	Btree_stat *root = tree->mgmtData;

	Btree *node = root->mgmtData;
	int i;

	if (!root->num_nodes) {

		// tree is empty
		root->num_nodes++;

		// create a new nodes
		createNew(node, key, rid);

		// the toptal number of nodes change
		root->num_inserts = root->num_inserts + 1;

		// update the statistic info of the tree
		updateStat(tree, root);

		return RC_OK;
	}


	// find a place where the new node should go
	node = find_node_to_insert(root, key);

	// traverse till the end
	Btree* temp1 = Rootnode;

	while (temp1) {

		for (i = 0; i < temp1->num_keys; i++) {

			// check if theres a match
			if (temp1->keys[i] == key->v.intV) {

				// update the stat info
				updateStat(tree, root);
				return RC_OK;
			}

		}

		temp1 = temp1->next;
	}


	// check which side should we traverse
	if (node->num_keys < root->order) {

		// this is a leaf node
		insertLeaf(node, key, rid);

		
		root->num_inserts = root->num_inserts + 1;

		// update the stat info
		updateStat(tree, root);

		return RC_OK;
	}

	// check if we got aq match
	if (node->num_keys == root->order) {

		// split the current node and insert
		splitInsert(tree, root, node, key, rid);

		
		root->num_inserts = root->num_inserts + 1;

		// update the stat info
		updateStat(tree, root);

		return RC_OK;
	}

	// ok
	return RC_OK;
}
Example #11
0
void BcmPort::updateStats() {
  // TODO: It would be nicer to use a monotonic clock, but unfortunately
  // the ServiceData code currently expects everyone to use system time.
  auto now = duration_cast<seconds>(system_clock::now().time_since_epoch());

  updateStat(now, &inBytes_, opennsl_spl_snmpIfHCInOctets);
  updateStat(now, &inUnicastPkts_, opennsl_spl_snmpIfHCInUcastPkts);
  updateStat(now, &inMulticastPkts_, opennsl_spl_snmpIfHCInMulticastPkts);
  updateStat(now, &inBroadcastPkts_, opennsl_spl_snmpIfHCInBroadcastPkts);
  updateStat(now, &inDiscards_, opennsl_spl_snmpIfInDiscards);
  updateStat(now, &inErrors_, opennsl_spl_snmpIfInErrors);

  updateStat(now, &outBytes_, opennsl_spl_snmpIfHCOutOctets);
  updateStat(now, &outUnicastPkts_, opennsl_spl_snmpIfHCOutUcastPkts);
  updateStat(now, &outMulticastPkts_, opennsl_spl_snmpIfHCOutMulticastPkts);
  updateStat(now, &outBroadcastPkts_, opennsl_spl_snmpIfHCOutBroadcastPckts);
  updateStat(now, &outDiscards_, opennsl_spl_snmpIfOutDiscards);
  updateStat(now, &outErrors_, opennsl_spl_snmpIfOutErrors);

  setAdditionalStats(now);

  // Update the queue length stat
  uint32_t qlength;
  auto ret = opennsl_port_queued_count_get(unit_, port_, &qlength);
  if (OPENNSL_FAILURE(ret)) {
    LOG(ERROR) << "Failed to get queue length for port " << port_
               << " :" << opennsl_errmsg(ret);
  } else {
    SpinLockHolder guard(outQueueLen_.first.get());
    outQueueLen_.second->addValue(now, qlength);
    // TODO: outQueueLen_ only exports the average queue length over the last
    // 60 seconds, 10 minutes, etc.
    // We should also export the current value.  We could use a simple counter
    // or a dynamic counter for this.
  }

  // Update the packet length histograms
  updatePktLenHist(now, &inPktLengths_, kInPktLengthStats);
  updatePktLenHist(now, &outPktLengths_, kOutPktLengthStats);
};