Index: src/libchcore/EngineConstants.h =================================================================== diff -u --- src/libchcore/EngineConstants.h (revision 0) +++ src/libchcore/EngineConstants.h (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -0,0 +1,27 @@ +// ============================================================================ +// Copyright (C) 2001-2016 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#ifndef __ENGINECONSTANTS_H__ +#define __ENGINECONSTANTS_H__ + +namespace chcore +{ + static const unsigned long long AssumedFileMinDataSize = 4096; +} + +#endif Index: src/libchcore/TSubTaskStatsSnapshot.cpp =================================================================== diff -u -rbe569bc86280887eeebb8d3e9489f6fc17c570e6 -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/TSubTaskStatsSnapshot.cpp (.../TSubTaskStatsSnapshot.cpp) (revision be569bc86280887eeebb8d3e9489f6fc17c570e6) +++ src/libchcore/TSubTaskStatsSnapshot.cpp (.../TSubTaskStatsSnapshot.cpp) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -25,6 +25,7 @@ #include #include "MathFunctions.h" #include "TBufferSizes.h" +#include "EngineConstants.h" namespace chcore { @@ -68,11 +69,11 @@ double TSubTaskStatsSnapshot::CalculateProgress() const { - // we're treating each of the items as 512B object to process + // we're treating each of the items as 4k object to process // to have some balance between items' count and items' size in // progress information - unsigned long long ullProcessed = 512ULL * m_fcProcessedCount + m_ullProcessedSize; - unsigned long long ullTotal = 512ULL * m_fcTotalCount + m_ullTotalSize; + unsigned long long ullProcessed = AssumedFileMinDataSize * m_fcProcessedCount + m_ullProcessedSize; + unsigned long long ullTotal = AssumedFileMinDataSize * m_fcTotalCount + m_ullTotalSize; if (ullTotal != 0) return Math::Div64(ullProcessed, ullTotal); @@ -94,11 +95,26 @@ m_dSizeSpeed = dSizeSpeed; } + double TSubTaskStatsSnapshot::GetSizeSpeed() const + { + if(m_bSubTaskIsRunning) + return m_dSizeSpeed; + + return 0.0; + } + void TSubTaskStatsSnapshot::SetCountSpeed(double dCountSpeed) { m_dCountSpeed = dCountSpeed; } + double TSubTaskStatsSnapshot::GetCountSpeed() const + { + if(m_bSubTaskIsRunning) + return m_dCountSpeed; + return 0.0; + } + double TSubTaskStatsSnapshot::GetAvgSizeSpeed() const { if (m_timeElapsed) @@ -111,8 +127,8 @@ { if (m_timeElapsed) return Math::Div64(m_fcProcessedCount, m_timeElapsed / 1000.0); - else - return 0.0; + + return 0.0; } double TSubTaskStatsSnapshot::GetCombinedProgress() const Index: src/libchcore/TSubTaskStatsSnapshot.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/TSubTaskStatsSnapshot.h (.../TSubTaskStatsSnapshot.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/TSubTaskStatsSnapshot.h (.../TSubTaskStatsSnapshot.h) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -85,9 +85,9 @@ // speed void SetSizeSpeed(double dSizeSpeed); - double GetSizeSpeed() const { return m_dSizeSpeed; } + double GetSizeSpeed() const; void SetCountSpeed(double dCountSpeed); - double GetCountSpeed() const { return m_dCountSpeed; } + double GetCountSpeed() const; double GetAvgSizeSpeed() const; double GetAvgCountSpeed() const; Index: src/libchcore/TTaskManagerStatsSnapshot.cpp =================================================================== diff -u -r294b7d63dfadb4e39fcbb52087983616981d00bd -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/TTaskManagerStatsSnapshot.cpp (.../TTaskManagerStatsSnapshot.cpp) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) +++ src/libchcore/TTaskManagerStatsSnapshot.cpp (.../TTaskManagerStatsSnapshot.cpp) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -23,6 +23,7 @@ #include "stdafx.h" #include "TTaskManagerStatsSnapshot.h" #include "MathFunctions.h" +#include "EngineConstants.h" namespace chcore { @@ -111,21 +112,28 @@ m_ullProcessedSize += spTaskStats->GetProcessedSize(); m_ullTotalSize += spTaskStats->GetTotalSize(); + + if(spTaskStats->IsTaskRunning()) + { + m_dCountSpeed += spTaskStats->GetCountSpeed(); + m_dSizeSpeed += spTaskStats->GetSizeSpeed(); + } - m_dCountSpeed += spTaskStats->GetCountSpeed(); - m_dSizeSpeed += spTaskStats->GetSizeSpeed(); - m_dAvgCountSpeed += spTaskStats->GetAvgCountSpeed(); m_dAvgSizeSpeed += spTaskStats->GetAvgSizeSpeed(); } - static_assert(AssumedFileEquivalentSize == TTaskStatsSnapshot::AssumedFileEquivalentSize, "File equivalent sizes differs"); + if(!m_vTasksSnapshots.empty()) + { + m_dAvgCountSpeed /= m_vTasksSnapshots.size(); + m_dAvgSizeSpeed /= m_vTasksSnapshots.size(); + } - // we're treating each of the items as 512B object to process + // we're treating each of the items as 4k object to process // to have some balance between items' count and items' size in // progress information - unsigned long long ullProcessed = AssumedFileEquivalentSize * m_ullProcessedCount + m_ullProcessedSize; - unsigned long long ullTotal = AssumedFileEquivalentSize * m_ullTotalCount + m_ullTotalSize; + unsigned long long ullProcessed = AssumedFileMinDataSize * m_ullProcessedCount + m_ullProcessedSize; + unsigned long long ullTotal = AssumedFileMinDataSize * m_ullTotalCount + m_ullTotalSize; if (ullTotal != 0) m_dCombinedProgress = Math::Div64(ullProcessed, ullTotal); Index: src/libchcore/TTaskManagerStatsSnapshot.h =================================================================== diff -u -r294b7d63dfadb4e39fcbb52087983616981d00bd -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/TTaskManagerStatsSnapshot.h (.../TTaskManagerStatsSnapshot.h) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) +++ src/libchcore/TTaskManagerStatsSnapshot.h (.../TTaskManagerStatsSnapshot.h) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -31,9 +31,6 @@ class LIBCHCORE_API TTaskManagerStatsSnapshot { public: - static const unsigned long long AssumedFileEquivalentSize = 4096; - - public: TTaskManagerStatsSnapshot(); TTaskManagerStatsSnapshot(const TTaskManagerStatsSnapshot& rSrc) = delete; Index: src/libchcore/TTaskStatsSnapshot.cpp =================================================================== diff -u -r294b7d63dfadb4e39fcbb52087983616981d00bd -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) +++ src/libchcore/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -23,6 +23,7 @@ #include "stdafx.h" #include "TTaskStatsSnapshot.h" #include "MathFunctions.h" +#include "EngineConstants.h" namespace chcore { @@ -102,15 +103,18 @@ m_ullProcessedSize += spSubtaskStats->GetProcessedSize(); m_ullTotalSize += spSubtaskStats->GetTotalSize(); - m_dTaskCountSpeed += spSubtaskStats->GetCountSpeed(); - m_dTaskSizeSpeed += spSubtaskStats->GetSizeSpeed(); + if(IsTaskRunning()) + { + m_dTaskCountSpeed += spSubtaskStats->GetCountSpeed(); + m_dTaskSizeSpeed += spSubtaskStats->GetSizeSpeed(); + } } // we're treating each of the items as 4096 bytes object to process // to have some balance between items' count and items' size in // progress information - unsigned long long ullProcessed = AssumedFileEquivalentSize * m_ullProcessedCount + m_ullProcessedSize; - unsigned long long ullTotal = AssumedFileEquivalentSize * m_ullTotalCount + m_ullTotalSize; + unsigned long long ullProcessed = AssumedFileMinDataSize * m_ullProcessedCount + m_ullProcessedSize; + unsigned long long ullTotal = AssumedFileMinDataSize * m_ullTotalCount + m_ullTotalSize; if (ullTotal != 0) m_dCombinedProgress = Math::Div64(ullProcessed, ullTotal); Index: src/libchcore/TTaskStatsSnapshot.h =================================================================== diff -u -r294b7d63dfadb4e39fcbb52087983616981d00bd -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/TTaskStatsSnapshot.h (.../TTaskStatsSnapshot.h) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) +++ src/libchcore/TTaskStatsSnapshot.h (.../TTaskStatsSnapshot.h) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -36,9 +36,6 @@ class LIBCHCORE_API TTaskStatsSnapshot { public: - static const unsigned long long AssumedFileEquivalentSize = 4096; - - public: TTaskStatsSnapshot(); void Clear(); Index: src/libchcore/libchcore.vc140.vcxproj =================================================================== diff -u -r8163be49a92698ada689f27b2dbe0caae69a7d5c -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/libchcore.vc140.vcxproj (.../libchcore.vc140.vcxproj) (revision 8163be49a92698ada689f27b2dbe0caae69a7d5c) +++ src/libchcore/libchcore.vc140.vcxproj (.../libchcore.vc140.vcxproj) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -468,6 +468,7 @@ + Index: src/libchcore/libchcore.vc140.vcxproj.filters =================================================================== diff -u -r8163be49a92698ada689f27b2dbe0caae69a7d5c -r2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b --- src/libchcore/libchcore.vc140.vcxproj.filters (.../libchcore.vc140.vcxproj.filters) (revision 8163be49a92698ada689f27b2dbe0caae69a7d5c) +++ src/libchcore/libchcore.vc140.vcxproj.filters (.../libchcore.vc140.vcxproj.filters) (revision 2a34de9ddfcfb4a1ed4c61ece641d37b91c23b6b) @@ -81,9 +81,6 @@ {953a12ea-2aa5-4c7a-a310-a461ce8b962f} - - {0bd6a559-b992-4f1d-abe6-f8105a9d5f50} - {94659973-1dd0-4e22-83c6-2fc26d3bf56e} @@ -102,6 +99,9 @@ {712c0e1a-c6e3-4aab-8322-a9eea42e6d81} + + {076cbf8f-0110-48a9-9cbe-9929534ba1d1} + @@ -525,6 +525,9 @@ Source Files\Tools + + Source Files\Shared +