10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Could somebody please explain to me why and how the highlighted line(s) (?) of code puts the "test" evaluation into "result" and then to $enable_static ? Or does not ?
I did comment out the original code and changed it to what I feel is less cryptic , but the "result" is still wrong =... (3 Replies)
Discussion started by: anne
3 Replies
2. Shell Programming and Scripting
Hello,
I need help with a test command.
Here is what I am trying to do :
I've got an interactive script that check if configuration files exist on 2 different directories, then all configuration files are print on screen by a short name.
My problem is when you type a "wrong name" or... (12 Replies)
Discussion started by: Aswex
12 Replies
3. Shell Programming and Scripting
hello,
i'v trying to use the TEST command and i have some problems with it.
i am trying kill all proccess wich is greater than 25.
i started with - ps -f | grep -v TTY | awk '{print $4}'
but i dont know how to proceed from here..
10x a lot, Daniel. (11 Replies)
Discussion started by: dadiT
11 Replies
4. Shell Programming and Scripting
How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies
5. Shell Programming and Scripting
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Discussion started by: Max89
1 Replies
6. UNIX for Dummies Questions & Answers
Hi all!
I'm new to shell scripting, and I need to do a diff between two dirs. One of them (dir_old) contains many files, and the other (dir_new) contains just a set of 8 files, all starting with MC and extension .CP.
The problem I have is that dir_old contains about 20 files that start with... (1 Reply)
Discussion started by: fpp666
1 Replies
7. Programming
I'm very new to C and could use a little help.
I'm testing to make sure the command is running as it's proper name, if not then fail.
if (strcmp(argv, "xinit") != 0) {
fprintf(stdout, "name = %s length = %d\n",argv,l);
usage(0);
}
This works if the command is... (3 Replies)
Discussion started by: nck
3 Replies
8. Shell Programming and Scripting
I have been looking into searching various files to display output.
The search criteria will be a month and year to output various numbers in the files.
is there any way to do this with the TEST function or would it have to be another way? (4 Replies)
Discussion started by: amatuer_lee_3
4 Replies
9. AIX
Hello,
I am trying to add some tests to existing code. The code already contains some test commands. An example is as follows...
] then
Does anyone know the purpose of the double equals? I would have used a single equals sign... (2 Replies)
Discussion started by: JWilliams
2 Replies
10. UNIX for Dummies Questions & Answers
Hi everyone,
I am new to UNIX and scripting, and I have some problems with the test command.
when i try to execute the command:
test 20070327.gz > 20070320.gz
i try to make a charachter string comparison between the two strings or the two files, to make sure that 20070327.gz is greater than... (2 Replies)
Discussion started by: marwan
2 Replies
MYSQLND_QC_GET_NORMALIZED_QUERY_TRACE_LOG(3) 1 MYSQLND_QC_GET_NORMALIZED_QUERY_TRACE_LOG(3)
mysqlnd_qc_get_normalized_query_trace_log - Returns a normalized query trace log for each query inspected by the query cache
SYNOPSIS
array mysqlnd_qc_get_normalized_query_trace_log (void )
DESCRIPTION
Returns a normalized query trace log for each query inspected by the query cache. The collection of the trace log is disabled by default.
To collect the trace log you have to set the PHP configuration directive mysqlnd_qc.collect_normalized_query_trace to 1
Entries in the trace log are grouped by the normalized query statement. The normalized query statement is the query statement with all
statement parameter values being replaced with a question mark. For example, the two statements SELECT id FROM test WHERE id = 1 and SELECT
id FROM test WHERE id = 2 are normalized as SELECT id FROM test WHERE id = ?. Whenever a statement is inspected by the query cache which
matches the normalized statement pattern, its statistics are grouped by the normalized statement string.
PARAMETERS
This function has no parameters.
RETURN VALUES
An array of query log. Every list entry contains the normalized query stringand further detail information.
+---------------------+---------------------------------------------------+
| Key | |
| | |
| | Description |
| | |
+---------------------+---------------------------------------------------+
| | |
| query | |
| | |
| | Normalized statement string. |
| | |
| | |
| occurences | |
| | |
| | How many statements have matched the normalized |
| | statement string in addition to the one which has |
| | created the log entry. The value is zero if a |
| | statement has been normalized, its normalized |
| | representation has been added to the log but no |
| | further queries inspected by PECL/mysqlnd_qc have |
| | the same normalized statement string. |
| | |
| | |
|eligible_for_caching | |
| | |
| | Whether the statement could be cached. An state- |
| | ment eligible for caching has not necessarily |
| | been cached. It not possible to tell for sure if |
| | or how many cached statement have contributed to |
| | the aggregated normalized statement log entry. |
| | However, comparing the minimum and average run |
| | time one can make an educated guess. |
| | |
| | |
| avg_run_time | |
| | |
| | The average run time of all queries contributing |
| | to the query log entry. The run time is the time |
| | between sending the query statement to MySQL and |
| | receiving an answer from MySQL. |
| | |
| | |
| avg_store_time | |
| | |
| | The average store time of all queries contribut- |
| | ing to the query log entry. The store time is the |
| | time needed to fetch a statements result set from |
| | the server to the client and, storing it on the |
| | client. |
| | |
| | |
| min_run_time | |
| | |
| | The minimum run time of all queries contributing |
| | to the query log entry. |
| | |
| | |
| min_store_time | |
| | |
| | The minimum store time of all queries contribut- |
| | ing to the query log entry. |
| | |
| | |
| max_run_time | |
| | |
| | The maximum run time of all queries contributing |
| | to the query log entry. |
| | |
| | |
| max_store_time | |
| | |
| | The maximum store time of all queries contribut- |
| | ing to the query log entry. |
| | |
+---------------------+---------------------------------------------------+
EXAMPLES
Example #1
mysqlnd_qc_get_normalized_query_trace_log(3) example
mysqlnd_qc.collect_normalized_query_trace=1
<?php
/* Connect, create and populate test table */
$mysqli = new mysqli("host", "user", "password", "schema", "port", "socket");
$mysqli->query("DROP TABLE IF EXISTS test");
$mysqli->query("CREATE TABLE test(id INT)");
$mysqli->query("INSERT INTO test(id) VALUES(1), (2)");
/* not cached */
$res = $mysqli->query("SELECT id FROM test WHERE id = 1");
var_dump($res->fetch_assoc());
$res->free();
/* cache put */
$res = $mysqli->query("/*" . MYSQLND_QC_ENABLE_SWITCH . "*/" . "SELECT id FROM test WHERE id = 2");
var_dump($res->fetch_assoc());
$res->free();
/* cache hit */
$res = $mysqli->query("/*" . MYSQLND_QC_ENABLE_SWITCH . "*/" . "SELECT id FROM test WHERE id = 2");
var_dump($res->fetch_assoc());
$res->free();
var_dump(mysqlnd_qc_get_normalized_query_trace_log());
?>
The above examples will output:
array(1) {
["id"]=>
string(1) "1"
}
array(1) {
["id"]=>
string(1) "2"
}
array(1) {
["id"]=>
string(1) "2"
}
array(4) {
[0]=>
array(9) {
["query"]=>
string(25) "DROP TABLE IF EXISTS test"
["occurences"]=>
int(0)
["eligible_for_caching"]=>
bool(false)
["avg_run_time"]=>
int(0)
["min_run_time"]=>
int(0)
["max_run_time"]=>
int(0)
["avg_store_time"]=>
int(0)
["min_store_time"]=>
int(0)
["max_store_time"]=>
int(0)
}
[1]=>
array(9) {
["query"]=>
string(27) "CREATE TABLE test (id INT )"
["occurences"]=>
int(0)
["eligible_for_caching"]=>
bool(false)
["avg_run_time"]=>
int(0)
["min_run_time"]=>
int(0)
["max_run_time"]=>
int(0)
["avg_store_time"]=>
int(0)
["min_store_time"]=>
int(0)
["max_store_time"]=>
int(0)
}
[2]=>
array(9) {
["query"]=>
string(40) "INSERT INTO test (id ) VALUES (? ), (? )"
["occurences"]=>
int(0)
["eligible_for_caching"]=>
bool(false)
["avg_run_time"]=>
int(0)
["min_run_time"]=>
int(0)
["max_run_time"]=>
int(0)
["avg_store_time"]=>
int(0)
["min_store_time"]=>
int(0)
["max_store_time"]=>
int(0)
}
[3]=>
array(9) {
["query"]=>
string(31) "SELECT id FROM test WHERE id =?"
["occurences"]=>
int(2)
["eligible_for_caching"]=>
bool(true)
["avg_run_time"]=>
int(159)
["min_run_time"]=>
int(12)
["max_run_time"]=>
int(307)
["avg_store_time"]=>
int(10)
["min_store_time"]=>
int(8)
["max_store_time"]=>
int(13)
}
}
SEE ALSO
Runtime configuration, mysqlnd_qc.collect_normalized_query_trace, mysqlnd_qc.time_statistics, mysqlnd_qc_get_query_trace_log(3).
PHP Documentation Group MYSQLND_QC_GET_NORMALIZED_QUERY_TRACE_LOG(3)