From a26b2c537312b59ff991486e9cde6e5a22eebc32 Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 14 Jun 2006 08:00:48 +0000 Subject: * [Improved]: - script_save_mapreg for MapregSQL Saving to display perfomance only in slow queries. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7150 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 3 +++ src/map/script.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 7e605b08f..71c051380 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/06/14 + * [Improved]: + - script_save_mapreg for MapregSQL Saving to display perfomance only in slow + queries. [Lance] * [Improved]: - npc_parse_script to show information and remove duplicated NPCs [Lance] 2006/06/13 diff --git a/src/map/script.c b/src/map/script.c index fa61ab6b1..05cc383c3 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11930,11 +11930,12 @@ static int script_save_mapreg(void) mapregstr_db->foreach(mapregstr_db,script_save_mapreg_strsub,fp); lock_fclose(fp,mapreg_txt,&lock); #else - int perfomance = gettick_nocache(); + int perfomance = (int)time(NULL); mapreg_db->foreach(mapreg_db,script_save_mapreg_intsub); // [zBuffer] mapregstr_db->foreach(mapregstr_db,script_save_mapreg_strsub); - perfomance = (gettick_nocache() - perfomance) / 1000; - ShowInfo("Mapreg saved in %d seconds.\n", perfomance); + perfomance = ((int)time(NULL) - perfomance) / 1000; + if(perfomance > 2) + ShowWarning("Slow Query: MapregSQL Saving @ %d second(s).\n", perfomance); #endif mapreg_dirty=0; return 0; -- cgit v1.2.3-70-g09d2