yum install systemtap kernel-devel
- 找到内核版本和glibc版本
use hyper::{Body, Request, Response, Server}; | |
use routerify_lite::{RequestExt, Router, RouterService}; | |
use std::{convert::Infallible, net::SocketAddr}; | |
async fn home_handler(_: Request<Body>) -> Result<Response<Body>, Infallible> { | |
Ok(Response::new(Body::from("Home page"))) | |
} | |
async fn hello_handler(req: Request<Body>) -> Result<Response<Body>, Infallible> { | |
let user = req.param("name").unwrap(); |
[package] | |
name = "tokio-psql" | |
version = "0.1.0" | |
authors = ["Jinhua Luo <home_king@163.com>"] | |
edition = "2018" | |
[dependencies] | |
futures-preview = "=0.3.0-alpha.19" | |
tokio = "0.2.0-alpha.6" | |
tokio-postgres= { git = "https://github.com/sfackler/rust-postgres" } |
package foo.bar.flinkapp; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.io.StringWriter; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Properties; |
#!/usr/bin/env stap++ | |
global exec_begin | |
global stats | |
probe @pfunc(ngx_epoll_process_events) | |
{ | |
exec_begin = gettimeofday_us() | |
} |
$ time luajit /tmp/test.lua | |
real 0m4.923s | |
user 0m4.912s | |
sys 0m0.020s |
#!/usr/bin/env perl | |
# Copyright (C) Yichun Zhang (agentzh) | |
# Thanks Brendan Gregg for the inspiration given here: | |
# http://dtrace.org/blogs/brendan/2011/07/08/off-cpu-performance-analysis/ | |
use 5.006001; | |
use strict; | |
use warnings; |
king@debian:~$ time ./a.out | |
real 0m10.261s | |
user 0m3.040s | |
sys 0m17.312s | |
king@debian:~$ time go run pthread.go | |
real 0m4.017s | |
user 0m5.444s |
--- testpq.go 2015-07-17 16:18:53.616212373 +0800 | |
+++ testpq2.go 2015-07-17 16:03:03.420162955 +0800 | |
@@ -8,6 +8,9 @@ | |
_ "github.com/lib/pq" | |
) | |
+//#include <unistd.h> | |
+import "C" | |
+ | |
func query(db *sql.DB, tstart time.Time, tend time.Time) { |