Commit 1e770439 authored by marko's avatar marko

branches/zip: Enclose some timestamp functions in #ifndef UNIV_HOTBACKUP.

parent f1acb7fb
...@@ -216,6 +216,7 @@ UNIV_INTERN ...@@ -216,6 +216,7 @@ UNIV_INTERN
ib_time_t ib_time_t
ut_time(void); ut_time(void);
/*=========*/ /*=========*/
#ifndef UNIV_HOTBACKUP
/**********************************************************//** /**********************************************************//**
Returns system time. Returns system time.
Upon successful completion, the value 0 is returned; otherwise the Upon successful completion, the value 0 is returned; otherwise the
...@@ -248,6 +249,7 @@ UNIV_INTERN ...@@ -248,6 +249,7 @@ UNIV_INTERN
uint uint
ut_time_ms(void); ut_time_ms(void);
/*============*/ /*============*/
#endif /* !UNIV_HOTBACKUP */
/**********************************************************//** /**********************************************************//**
Returns the difference of two times in seconds. Returns the difference of two times in seconds.
......
...@@ -47,8 +47,10 @@ Created June 2005 by Marko Makela ...@@ -47,8 +47,10 @@ Created June 2005 by Marko Makela
# define buf_LRU_stat_inc_unzip() ((void) 0) # define buf_LRU_stat_inc_unzip() ((void) 0)
#endif /* !UNIV_HOTBACKUP */ #endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_HOTBACKUP
/** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */ /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1]; UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
#endif /* !UNIV_HOTBACKUP */
/* Please refer to ../include/page0zip.ic for a description of the /* Please refer to ../include/page0zip.ic for a description of the
compressed page format. */ compressed page format. */
...@@ -1144,7 +1146,9 @@ page_zip_compress( ...@@ -1144,7 +1146,9 @@ page_zip_compress(
ulint* offsets = NULL; ulint* offsets = NULL;
ulint n_blobs = 0; ulint n_blobs = 0;
byte* storage;/* storage of uncompressed columns */ byte* storage;/* storage of uncompressed columns */
#ifndef UNIV_HOTBACKUP
ullint usec = ut_time_us(NULL); ullint usec = ut_time_us(NULL);
#endif /* !UNIV_HOTBACKUP */
#ifdef PAGE_ZIP_COMPRESS_DBG #ifdef PAGE_ZIP_COMPRESS_DBG
FILE* logfile = NULL; FILE* logfile = NULL;
#endif #endif
...@@ -1208,7 +1212,9 @@ page_zip_compress( ...@@ -1208,7 +1212,9 @@ page_zip_compress(
} }
} }
#endif /* PAGE_ZIP_COMPRESS_DBG */ #endif /* PAGE_ZIP_COMPRESS_DBG */
#ifndef UNIV_HOTBACKUP
page_zip_stat[page_zip->ssize - 1].compressed++; page_zip_stat[page_zip->ssize - 1].compressed++;
#endif /* !UNIV_HOTBACKUP */
if (UNIV_UNLIKELY(n_dense * PAGE_ZIP_DIR_SLOT_SIZE if (UNIV_UNLIKELY(n_dense * PAGE_ZIP_DIR_SLOT_SIZE
>= page_zip_get_size(page_zip))) { >= page_zip_get_size(page_zip))) {
...@@ -1345,8 +1351,10 @@ err_exit: ...@@ -1345,8 +1351,10 @@ err_exit:
fclose(logfile); fclose(logfile);
} }
#endif /* PAGE_ZIP_COMPRESS_DBG */ #endif /* PAGE_ZIP_COMPRESS_DBG */
#ifndef UNIV_HOTBACKUP
page_zip_stat[page_zip->ssize - 1].compressed_usec page_zip_stat[page_zip->ssize - 1].compressed_usec
+= ut_time_us(NULL) - usec; += ut_time_us(NULL) - usec;
#endif /* !UNIV_HOTBACKUP */
return(FALSE); return(FALSE);
} }
...@@ -1404,12 +1412,14 @@ err_exit: ...@@ -1404,12 +1412,14 @@ err_exit:
fclose(logfile); fclose(logfile);
} }
#endif /* PAGE_ZIP_COMPRESS_DBG */ #endif /* PAGE_ZIP_COMPRESS_DBG */
#ifndef UNIV_HOTBACKUP
{ {
page_zip_stat_t* zip_stat page_zip_stat_t* zip_stat
= &page_zip_stat[page_zip->ssize - 1]; = &page_zip_stat[page_zip->ssize - 1];
zip_stat->compressed_ok++; zip_stat->compressed_ok++;
zip_stat->compressed_usec += ut_time_us(NULL) - usec; zip_stat->compressed_usec += ut_time_us(NULL) - usec;
} }
#endif /* !UNIV_HOTBACKUP */
return(TRUE); return(TRUE);
} }
...@@ -2820,7 +2830,9 @@ page_zip_decompress( ...@@ -2820,7 +2830,9 @@ page_zip_decompress(
ulint trx_id_col = ULINT_UNDEFINED; ulint trx_id_col = ULINT_UNDEFINED;
mem_heap_t* heap; mem_heap_t* heap;
ulint* offsets; ulint* offsets;
#ifndef UNIV_HOTBACKUP
ullint usec = ut_time_us(NULL); ullint usec = ut_time_us(NULL);
#endif /* !UNIV_HOTBACKUP */
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
UNIV_MEM_ASSERT_W(page, UNIV_PAGE_SIZE); UNIV_MEM_ASSERT_W(page, UNIV_PAGE_SIZE);
...@@ -2976,12 +2988,14 @@ err_exit: ...@@ -2976,12 +2988,14 @@ err_exit:
page_zip_fields_free(index); page_zip_fields_free(index);
mem_heap_free(heap); mem_heap_free(heap);
#ifndef UNIV_HOTBACKUP
{ {
page_zip_stat_t* zip_stat page_zip_stat_t* zip_stat
= &page_zip_stat[page_zip->ssize - 1]; = &page_zip_stat[page_zip->ssize - 1];
zip_stat->decompressed++; zip_stat->decompressed++;
zip_stat->decompressed_usec += ut_time_us(NULL) - usec; zip_stat->decompressed_usec += ut_time_us(NULL) - usec;
} }
#endif /* !UNIV_HOTBACKUP */
/* Update the stat counter for LRU policy. */ /* Update the stat counter for LRU policy. */
buf_LRU_stat_inc_unzip(); buf_LRU_stat_inc_unzip();
......
...@@ -132,6 +132,7 @@ ut_time(void) ...@@ -132,6 +132,7 @@ ut_time(void)
return(time(NULL)); return(time(NULL));
} }
#ifndef UNIV_HOTBACKUP
/**********************************************************//** /**********************************************************//**
Returns system time. Returns system time.
Upon successful completion, the value 0 is returned; otherwise the Upon successful completion, the value 0 is returned; otherwise the
...@@ -215,6 +216,7 @@ ut_time_ms(void) ...@@ -215,6 +216,7 @@ ut_time_ms(void)
return((uint) tv.tv_sec * 1000 + tv.tv_usec / 1000); return((uint) tv.tv_sec * 1000 + tv.tv_usec / 1000);
} }
#endif /* !UNIV_HOTBACKUP */
/**********************************************************//** /**********************************************************//**
Returns the difference of two times in seconds. Returns the difference of two times in seconds.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment