8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-31 00:43:02 +01:00
firebird-mirror/src/jrd/ntrace.h

75 lines
2.2 KiB
C
Raw Normal View History

/*
* PROGRAM: JRD Access Method
* MODULE: ntrace.h
* DESCRIPTION: Trace API header
*
* The contents of this file are subject to the Initial
* Developer's Public License Version 1.0 (the "License");
* you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
*
* Software distributed under the License is distributed AS IS,
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights
* and limitations under the License.
*
* The Original Code was created by Nickolay Samofatov
* for the Firebird Open Source RDBMS project.
*
* Copyright (c) 2004 Nickolay Samofatov <nickolay@broadviewsoftware.com>
* and all contributors signed below.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
2009-02-01 23:10:12 +01:00
* 2008 Khorsun Vladyslav
*
*/
2009-02-01 23:10:12 +01:00
#ifndef FIREBIRD_NTRACE_H
#define FIREBIRD_NTRACE_H
2014-09-29 13:03:47 +02:00
#include "firebird/Interface.h"
2009-02-01 23:10:12 +01:00
const int DBB_max_rel_count = 8; // must be the same as DBB_max_count from jrd.h
2009-11-27 09:34:34 +01:00
// Performance counters for entire database
2009-02-01 23:10:12 +01:00
enum {
DBB_fetches_count = 0,
DBB_reads_count,
DBB_marks_count,
DBB_writes_count,
DBB_max_dbb_count
};
2009-11-27 09:34:34 +01:00
// Performance counters for individual table
2014-09-29 13:03:47 +02:00
typedef int ntrace_relation_t;
2009-02-02 04:35:52 +01:00
struct TraceCounts
{
2009-11-27 09:34:34 +01:00
ntrace_relation_t trc_relation_id; // Relation ID
const char* trc_relation_name; // Relation name
2014-09-29 13:03:47 +02:00
const ISC_INT64* trc_counters; // Pointer to allow easy addition of new counters
};
2009-11-27 09:34:34 +01:00
// Performance statistics for operation
2009-04-04 18:39:31 +02:00
struct PerformanceInfo
2008-12-22 10:00:05 +01:00
{
2014-09-29 13:03:47 +02:00
ISC_INT64 pin_time; // Total operation time in milliseconds
ISC_INT64* pin_counters; // Pointer to allow easy addition of new counters
2009-02-01 23:10:12 +01:00
2009-11-27 09:34:34 +01:00
size_t pin_count; // Number of relations involved in analysis
struct TraceCounts* pin_tables; // Pointer to array with table stats
2014-09-29 13:03:47 +02:00
ISC_INT64 pin_records_fetched; // records fetched from statement/procedure
};
2014-09-29 13:03:47 +02:00
typedef unsigned int ntrace_result_t;
typedef unsigned char ntrace_byte_t;
typedef ISC_UINT64 ntrace_counter_t;
typedef unsigned int ntrace_process_state_t;
typedef ISC_UINT64 ntrace_mask_t;
2009-02-02 04:35:52 +01:00
#endif // FIREBIRD_NTRACE_H