yum install systemtap kernel-devel
- 找到内核版本和glibc版本
use hyper::service::{make_service_fn, service_fn}; | |
use hyper::{Body, Request, Response, Server}; | |
use std::convert::Infallible; | |
use std::net::SocketAddr; | |
async fn hello_world(_req: Request<Body>) -> Result<Response<Body>, Infallible> { | |
//let path = _req.uri().path(); | |
//let v: Vec<&str> = path.split('/').collect(); | |
//let str = format!("hello {}", v[2]); | |
//Ok(Response::new(str.into())) |
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() | |
} |
$ gcc -o test test.c -llua -lm -ldl | |
$ time ./test state | |
real 0m21.470s | |
user 0m20.472s | |
sys 0m0.980s | |
$ time ./test |
$ 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; |