
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
mysql-slowquery-parser
Advanced tools
Slow query log parser for MySQL
Add this line to your application's Gemfile:
gem 'mysql-slowquery-parser'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mysql-slowquery-parser
slowquery = <<SLOW
/usr/local/Cellar/mysql/5.6.12/bin/mysqld, Version: 5.6.12 (Source distribution). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
# Time: 140128 13:39:11
# User@Host: [user] @ localhost [] Id: 8
# Query_time: 2.001227 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
SET timestamp=1390883951;
SELECT
*
FROM
mysql.user;
/usr/local/Cellar/mysql/5.6.12/bin/mysqld, Version: 5.6.12 (Source distribution). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
# Time: 140326 0:36:56
# User@Host: root[root] @ localhost [] Id: 51
# Query_time: 10.001140 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
SET timestamp=1395761816;
select sleep(10);
# Time: 140326 0:37:11
# User@Host: root[root] @ localhost [] Id: 51
# Query_time: 10.001114 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 0
use mysql;
SET timestamp=1395761831;
select sleep(10);
SLOW
MySQLSlowQueryParser.parse(slowquery)
[
{
datetime: 1390883951,
user: 'user',
host: 'localhost',
query_time: 2.001227,
lock_time: 0.0,
rows_sent: 1,
rows_examined: 0,
sql: 'SELECT\n *\nFROM\n mysql.user'
},
{
datetime: 1395761816,
user: 'root',
host: 'localhost',
query_time: 10.00114,
lock_time: 0.0,
rows_sent: 1,
rows_examined: 0,
sql: 'select sleep(10)'
},
{
datetime: 1395761831,
user: 'root',
host: 'localhost',
query_time: 10.001114,
lock_time: 0.0,
rows_sent: 1,
rows_examined: 0,
db: 'mysql',
sql: 'select sleep(10)'
}
]
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that mysql-slowquery-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.