SlideShare une entreprise Scribd logo
1  sur  63
Operation Oriented Web Applications
                        Yokohama.pm#7
                            @kazeburo
Log::Minimal
#!/usr/bin/env perl

use strict;
use warnings;
use Log::Minimal;

critf("%s","foo");
warnf("%d %s", 1, "foo");

sub hoge {
    infoff("foo");
    debugff("bar");
};
hoge();

local $Log::Minimal::AUTODUMP = 1;
infof({ key => 'val' });
warnf("data is %s", { key => 'val' });
$ LM_DEBUG=1 perl /tmp/logminimal.pl


2011-05-11T15:57:49 [CRITICAL] foo at /tmp/logminimal.pl line 7
2011-05-11T15:57:49 [WARN] 1 foo at /tmp/logminimal.pl line 8


2011-05-11T15:57:49 [INFO] foo at /tmp/logminimal.pl line 11 ,/tmp/
logminimal.pl line 14
2011-05-11T15:57:49 [DEBUG] bar at /tmp/logminimal.pl line 12 ,/tmp/
logminimal.pl line 14


2011-05-11T15:57:49 [INFO] {'key' => 'val'} at /tmp/logminimal.pl line 17
2011-05-11T15:57:49 [WARN] data is {'key' => 'val'} at /tmp/logminimal.pl
line 18
local $Log::Minimal::PRINT = sub {
    my ( $time, $type, $message, $trace) = @_;
    print STDERR “[$type] $message $trace”;
};




local $Log::Minimal::LOG_LEVEL = "WARN";
infof("foo"); #print nothing
warnf(“xaicron++”);
local $Log::Minimal::AUTODUMP = 1;
warnf(“response => %s”,[ 200, [‘Content-Type’,‘text/
plain’],[‘OK’]]);

# 2011-05-11T15:56:14 [WARN] response => [200,
['Content-Type','text/plain'],['OK']] at ..




sub myerror {
    local $Log::Minimal::TRACE_LEVEL = 1;
    infof(@_);
}
myerror(“foo”);
use Log::Minimal;
use Plack::Builder;

builder {
    enable "Log::Minimal", autodump => 1;
    sub {
        my $env = shift;
        warnf("warn message");
        debugf("debug message");
        ...
    }
};



$ plackup -a demo.psgi
HTTP::Server::PSGI: Accepting connections at http://0:5000/
2011-05-11T16:32:24 [WARN] [/foo/bar/baz] warn message at /
tmp/demo.psgi line 8
2011-05-11T16:32:24 [DEBUG] [/foo/bar/baz] debug message at /
tmp/demo.psgi line 9
DBIx::Sunny
selectrow_arrayref($query, {}, @bind);




selectrow_hashref($query, {}, @bind);




selectall_arrayref($query, { Slice => {} }, @bind);




prepare($query) && execute(@bind)
use DBIx::Sunny;

my $dbh = DBIx::Sunny->connect(...);




use DBI;
use DBIx::Sunny;

my $dbh = DBIx->connect(...,{
    RootClass => ‘DBIx::Sunny’
});
DBIx::Sunny::Schema
package NoNoPaste::Data;
use parent qw/DBIx::Sunny::Schema/;

__PACKAGE__->query(
    'add_entry',
    id => 'Str',
    nick => { isa => 'Str', default => 'anonymouse' },
    body => 'Str',
    q{INSERT INTO entries ( id, nick, body, ctime )
        values ( ?, ?, ?, NOW() )},
);

__PACKAGE__->select_row(
    'entry',
    'id' => 'Uint',
    q{SELECT id,nick,body,ctime FROM entries WHERE id =?};
);

__PACKAGE__->select_all(
    'entries_multi',
    'id' => { isa => 'ArrayRef[Uint]' },
    q{SELECT id,nick,body,ctime FROM entries WHERE id IN (?)}
);
use parent qw/DBIx::Sunny::Schema/;

__PACKAGE__->                   (
     '          ',
          =>     /       ,
     [     =>        /       ,[..]],
     ‘    ’,
);
prepare && execute && fetchrow_arrayref->[0];




prepare && execute && fetchrow_hashref;




prepare && execute && push @result, $_ while fetchrow_hash;




prepare && execute
my $dbh = DBI->connect(...);
my $master = NoNoPaste::Data->new( dbh => $dbh );

# readonly   query
my $slave = NoNoPaste::Data->new( dbh => $dbh,
                                 readonly => 1 );
#
my $row = $master->add_entry(
    id => $id,
    nick => $nick,
    body => $body,
);

#
my $rows = $slave->entry_list( offset => $offset );
GreenBuckets
use Digest::MurmurHash qw/murmur_hash/;

for ( 1..100 ) {
    say murmur_hash(sprintf "test%03d", $_ );
}
use Digest::MurmurHash qw/murmur_hash/;

for ( 1..100 ) {
    say murmur_hash(sprintf "test%03d", $_ );
}
CREATE TABLE objects (
    id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    fid INT UNSIGNED NOT NULL,
    bucket_id INT UNSIGNED NOT NULL,
    rid SMALLINT UNSIGNED NOT NULL,
    gid SMALLINT UNSIGNED NOT NULL,
    filename VARCHAR(1024),
    INDEX (fid, bucket_id),
    INDEX (bucket_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin




SELECT * FROM objects WHERE fid = murmur($filename) AND
bucket_id = $bucket AND filename = $filename
CREATE TABLE entries_int (
    id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    fid INT UNSIGNED NOT NULL,
    bid INT UNSIGNED NOT NULL,
    filename VARCHAR(255) NOT NULL,
    INDEX (fid, bid),
    INDEX (bid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin




CREATE TABLE entries_char (
    id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    filename VARCHAR(255) NOT NULL,
    bid INT UNSIGNED NOT NULL,
    UNIQUE INDEX (filename, bid),
    INDEX (bid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin
.--------------------------------------------------.
| table_name   | total_kb | data_kb    | index_kb |
+--------------+-----------+-----------+-----------+
| entries_char | 3360.0000 | 1552.0000 | 1808.0000 |
| entries_int | 2080.0000 | 1552.0000 | 528.0000 |
'--------------+-----------+-----------+-----------'

               (filename      32    )
@nodes = sort {
    murmur_hash(join "/", $a->{node_id},$bucket,$filename)
    <=>
    murmur_hash(join "/", $b->{node_id},$bucket,$filename)
} @nodes;
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations
Log Minimal Perl Module Logging Operations

Contenu connexe

Tendances

Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteBram Vogelaar
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principlesPerl Careers
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stackBram Vogelaar
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStackBram Vogelaar
 
Observability with Consul Connect
Observability with Consul ConnectObservability with Consul Connect
Observability with Consul ConnectBram Vogelaar
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and othersYusuke Wada
 
Perl: Coro asynchronous
Perl: Coro asynchronous Perl: Coro asynchronous
Perl: Coro asynchronous Shmuel Fomberg
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesBram Vogelaar
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To MocoNaoya Ito
 
Any event intro
Any event introAny event intro
Any event introqiang
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkJeremy Kendall
 
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet
 

Tendances (20)

Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Bootstrapping multidc observability stack
Bootstrapping multidc observability stackBootstrapping multidc observability stack
Bootstrapping multidc observability stack
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
Follow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHPFollow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHP
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
 
Observability with Consul Connect
Observability with Consul ConnectObservability with Consul Connect
Observability with Consul Connect
 
Inside Bokete: Web Application with Mojolicious and others
Inside Bokete:  Web Application with Mojolicious and othersInside Bokete:  Web Application with Mojolicious and others
Inside Bokete: Web Application with Mojolicious and others
 
Lies, Damn Lies, and Benchmarks
Lies, Damn Lies, and BenchmarksLies, Damn Lies, and Benchmarks
Lies, Damn Lies, and Benchmarks
 
Perl: Coro asynchronous
Perl: Coro asynchronous Perl: Coro asynchronous
Perl: Coro asynchronous
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet Profiles
 
Developing apps using Perl
Developing apps using PerlDeveloping apps using Perl
Developing apps using Perl
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To Moco
 
Any event intro
Any event introAny event intro
Any event intro
 
Keeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro frameworkKeeping it small: Getting to know the Slim micro framework
Keeping it small: Getting to know the Slim micro framework
 
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
Puppet Camp Chicago 2014: Smoothing Troubles With Custom Types and Providers ...
 

Similaire à Log Minimal Perl Module Logging Operations

Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and BeyondJochen Rau
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Masahiro Nagano
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistenceHugo Hamon
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoMasahiro Nagano
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)Night Sailer
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data ObjectsWez Furlong
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Kang-min Liu
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges✅ William Pinaud
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?Radek Benkel
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
 
Ruby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersRuby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersAaron Patterson
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with ExtbaseJochen Rau
 
Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128PrinceGuru MS
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
R57shell
R57shellR57shell
R57shellady36
 

Similaire à Log Minimal Perl Module Logging Operations (20)

Extbase and Beyond
Extbase and BeyondExtbase and Beyond
Extbase and Beyond
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 TokyoIntroduction to CloudForecast / YAPC::Asia 2010 Tokyo
Introduction to CloudForecast / YAPC::Asia 2010 Tokyo
 
Blog Hacks 2011
Blog Hacks 2011Blog Hacks 2011
Blog Hacks 2011
 
PHP 5.4
PHP 5.4PHP 5.4
PHP 5.4
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
PHP Data Objects
PHP Data ObjectsPHP Data Objects
PHP Data Objects
 
Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)Good Evils In Perl (Yapc Asia)
Good Evils In Perl (Yapc Asia)
 
PHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP LimogesPHP in 2018 - Q4 - AFUP Limoges
PHP in 2018 - Q4 - AFUP Limoges
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Ruby on Rails: Tasty Burgers
Ruby on Rails: Tasty BurgersRuby on Rails: Tasty Burgers
Ruby on Rails: Tasty Burgers
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
Php tips-and-tricks4128
Php tips-and-tricks4128Php tips-and-tricks4128
Php tips-and-tricks4128
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
R57shell
R57shellR57shell
R57shell
 
My shell
My shellMy shell
My shell
 
Having Fun Programming!
Having Fun Programming!Having Fun Programming!
Having Fun Programming!
 

Plus de Masahiro Nagano

Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinAdvanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinMasahiro Nagano
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Masahiro Nagano
 
Big Master Data PHP BLT #1
Big Master Data PHP BLT #1Big Master Data PHP BLT #1
Big Master Data PHP BLT #1Masahiro Nagano
 
Stream processing in Mercari - Devsumi 2015 autumn LT
Stream processing in Mercari - Devsumi 2015 autumn LTStream processing in Mercari - Devsumi 2015 autumn LT
Stream processing in Mercari - Devsumi 2015 autumn LTMasahiro Nagano
 
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月Masahiro Nagano
 
ISUCONの勝ち方 YAPC::Asia Tokyo 2015
ISUCONの勝ち方 YAPC::Asia Tokyo 2015ISUCONの勝ち方 YAPC::Asia Tokyo 2015
ISUCONの勝ち方 YAPC::Asia Tokyo 2015Masahiro Nagano
 
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LTNorikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LTMasahiro Nagano
 
メルカリでのNorikraの活用、 Mackerelを添えて
メルカリでのNorikraの活用、 Mackerelを添えてメルカリでのNorikraの活用、 Mackerelを添えて
メルカリでのNorikraの活用、 Mackerelを添えてMasahiro Nagano
 
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LTGazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LTMasahiro Nagano
 
Mackerel & Norikra mackerel meetup #4 LT
Mackerel & Norikra mackerel meetup #4 LTMackerel & Norikra mackerel meetup #4 LT
Mackerel & Norikra mackerel meetup #4 LTMasahiro Nagano
 
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術Masahiro Nagano
 
Isucon makers casual talks
Isucon makers casual talksIsucon makers casual talks
Isucon makers casual talksMasahiro Nagano
 
blogサービスの全文検索の話 - #groonga を囲む夕べ
blogサービスの全文検索の話 - #groonga を囲む夕べblogサービスの全文検索の話 - #groonga を囲む夕べ
blogサービスの全文検索の話 - #groonga を囲む夕べMasahiro Nagano
 
Gazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapmGazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapmMasahiro Nagano
 
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014Masahiro Nagano
 
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LTWeb Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LTMasahiro Nagano
 
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版Masahiro Nagano
 
Webアプリケーションの パフォーマンス向上のコツ 実践編
 Webアプリケーションの パフォーマンス向上のコツ 実践編 Webアプリケーションの パフォーマンス向上のコツ 実践編
Webアプリケーションの パフォーマンス向上のコツ 実践編Masahiro Nagano
 
Webアプリケーションの パフォーマンス向上のコツ 概要編
 Webアプリケーションの パフォーマンス向上のコツ 概要編 Webアプリケーションの パフォーマンス向上のコツ 概要編
Webアプリケーションの パフォーマンス向上のコツ 概要編Masahiro Nagano
 
Webアプリケーションとメモリ
WebアプリケーションとメモリWebアプリケーションとメモリ
WebアプリケーションとメモリMasahiro Nagano
 

Plus de Masahiro Nagano (20)

Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/MinAdvanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
Advanced nginx in mercari - How to handle over 1,200,000 HTTPS Reqs/Min
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
 
Big Master Data PHP BLT #1
Big Master Data PHP BLT #1Big Master Data PHP BLT #1
Big Master Data PHP BLT #1
 
Stream processing in Mercari - Devsumi 2015 autumn LT
Stream processing in Mercari - Devsumi 2015 autumn LTStream processing in Mercari - Devsumi 2015 autumn LT
Stream processing in Mercari - Devsumi 2015 autumn LT
 
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
メルカリのデータベース戦略 / PHPとMySQLの怖い話 MyNA会2015年8月
 
ISUCONの勝ち方 YAPC::Asia Tokyo 2015
ISUCONの勝ち方 YAPC::Asia Tokyo 2015ISUCONの勝ち方 YAPC::Asia Tokyo 2015
ISUCONの勝ち方 YAPC::Asia Tokyo 2015
 
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LTNorikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
Norikraで作るPHPの例外検知システム YAPC::Asia Tokyo 2015 LT
 
メルカリでのNorikraの活用、 Mackerelを添えて
メルカリでのNorikraの活用、 Mackerelを添えてメルカリでのNorikraの活用、 Mackerelを添えて
メルカリでのNorikraの活用、 Mackerelを添えて
 
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LTGazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
Gazelle & CPAN modules for performance. Shibuya.pm Tech Talk #17 LT
 
Mackerel & Norikra mackerel meetup #4 LT
Mackerel & Norikra mackerel meetup #4 LTMackerel & Norikra mackerel meetup #4 LT
Mackerel & Norikra mackerel meetup #4 LT
 
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
ISUCON4 予選問題で(中略)、”my.cnf”に1行だけ足して予選通過ラインを突破するの術
 
Isucon makers casual talks
Isucon makers casual talksIsucon makers casual talks
Isucon makers casual talks
 
blogサービスの全文検索の話 - #groonga を囲む夕べ
blogサービスの全文検索の話 - #groonga を囲む夕べblogサービスの全文検索の話 - #groonga を囲む夕べ
blogサービスの全文検索の話 - #groonga を囲む夕べ
 
Gazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapmGazelle - Plack Handler for performance freaks #yokohamapm
Gazelle - Plack Handler for performance freaks #yokohamapm
 
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
Dockerで遊んでみよっかー YAPC::Asia Tokyo 2014
 
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LTWeb Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
Web Framework Benchmarksと Perl の現状報告会 YAPC::Asia Tokyo 2014 LT
 
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
ISUCONで学ぶ Webアプリケーションのパフォーマンス向上のコツ 実践編 完全版
 
Webアプリケーションの パフォーマンス向上のコツ 実践編
 Webアプリケーションの パフォーマンス向上のコツ 実践編 Webアプリケーションの パフォーマンス向上のコツ 実践編
Webアプリケーションの パフォーマンス向上のコツ 実践編
 
Webアプリケーションの パフォーマンス向上のコツ 概要編
 Webアプリケーションの パフォーマンス向上のコツ 概要編 Webアプリケーションの パフォーマンス向上のコツ 概要編
Webアプリケーションの パフォーマンス向上のコツ 概要編
 
Webアプリケーションとメモリ
WebアプリケーションとメモリWebアプリケーションとメモリ
Webアプリケーションとメモリ
 

Dernier

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Dernier (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Log Minimal Perl Module Logging Operations

  • 1. Operation Oriented Web Applications Yokohama.pm#7 @kazeburo
  • 2.
  • 3.
  • 5.
  • 6.
  • 7. #!/usr/bin/env perl use strict; use warnings; use Log::Minimal; critf("%s","foo"); warnf("%d %s", 1, "foo"); sub hoge { infoff("foo"); debugff("bar"); }; hoge(); local $Log::Minimal::AUTODUMP = 1; infof({ key => 'val' }); warnf("data is %s", { key => 'val' });
  • 8. $ LM_DEBUG=1 perl /tmp/logminimal.pl 2011-05-11T15:57:49 [CRITICAL] foo at /tmp/logminimal.pl line 7 2011-05-11T15:57:49 [WARN] 1 foo at /tmp/logminimal.pl line 8 2011-05-11T15:57:49 [INFO] foo at /tmp/logminimal.pl line 11 ,/tmp/ logminimal.pl line 14 2011-05-11T15:57:49 [DEBUG] bar at /tmp/logminimal.pl line 12 ,/tmp/ logminimal.pl line 14 2011-05-11T15:57:49 [INFO] {'key' => 'val'} at /tmp/logminimal.pl line 17 2011-05-11T15:57:49 [WARN] data is {'key' => 'val'} at /tmp/logminimal.pl line 18
  • 9. local $Log::Minimal::PRINT = sub { my ( $time, $type, $message, $trace) = @_; print STDERR “[$type] $message $trace”; }; local $Log::Minimal::LOG_LEVEL = "WARN"; infof("foo"); #print nothing warnf(“xaicron++”);
  • 10. local $Log::Minimal::AUTODUMP = 1; warnf(“response => %s”,[ 200, [‘Content-Type’,‘text/ plain’],[‘OK’]]); # 2011-05-11T15:56:14 [WARN] response => [200, ['Content-Type','text/plain'],['OK']] at .. sub myerror { local $Log::Minimal::TRACE_LEVEL = 1; infof(@_); } myerror(“foo”);
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. use Log::Minimal; use Plack::Builder; builder {     enable "Log::Minimal", autodump => 1;     sub {         my $env = shift;         warnf("warn message");         debugf("debug message");         ...     } }; $ plackup -a demo.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/ 2011-05-11T16:32:24 [WARN] [/foo/bar/baz] warn message at / tmp/demo.psgi line 8 2011-05-11T16:32:24 [DEBUG] [/foo/bar/baz] debug message at / tmp/demo.psgi line 9
  • 18.
  • 19.
  • 20.
  • 21. selectrow_arrayref($query, {}, @bind); selectrow_hashref($query, {}, @bind); selectall_arrayref($query, { Slice => {} }, @bind); prepare($query) && execute(@bind)
  • 22. use DBIx::Sunny; my $dbh = DBIx::Sunny->connect(...); use DBI; use DBIx::Sunny; my $dbh = DBIx->connect(...,{ RootClass => ‘DBIx::Sunny’ });
  • 23.
  • 25.
  • 26.
  • 27.
  • 28. package NoNoPaste::Data; use parent qw/DBIx::Sunny::Schema/; __PACKAGE__->query( 'add_entry', id => 'Str', nick => { isa => 'Str', default => 'anonymouse' }, body => 'Str', q{INSERT INTO entries ( id, nick, body, ctime ) values ( ?, ?, ?, NOW() )}, ); __PACKAGE__->select_row( 'entry', 'id' => 'Uint', q{SELECT id,nick,body,ctime FROM entries WHERE id =?}; ); __PACKAGE__->select_all( 'entries_multi', 'id' => { isa => 'ArrayRef[Uint]' }, q{SELECT id,nick,body,ctime FROM entries WHERE id IN (?)} );
  • 29. use parent qw/DBIx::Sunny::Schema/; __PACKAGE__-> ( ' ', => / , [ => / ,[..]], ‘ ’, );
  • 30. prepare && execute && fetchrow_arrayref->[0]; prepare && execute && fetchrow_hashref; prepare && execute && push @result, $_ while fetchrow_hash; prepare && execute
  • 31. my $dbh = DBI->connect(...); my $master = NoNoPaste::Data->new( dbh => $dbh ); # readonly query my $slave = NoNoPaste::Data->new( dbh => $dbh, readonly => 1 ); # my $row = $master->add_entry( id => $id, nick => $nick, body => $body, ); # my $rows = $slave->entry_list( offset => $offset );
  • 32.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50. use Digest::MurmurHash qw/murmur_hash/; for ( 1..100 ) { say murmur_hash(sprintf "test%03d", $_ ); }
  • 51. use Digest::MurmurHash qw/murmur_hash/; for ( 1..100 ) { say murmur_hash(sprintf "test%03d", $_ ); }
  • 52. CREATE TABLE objects ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, fid INT UNSIGNED NOT NULL, bucket_id INT UNSIGNED NOT NULL, rid SMALLINT UNSIGNED NOT NULL, gid SMALLINT UNSIGNED NOT NULL, filename VARCHAR(1024), INDEX (fid, bucket_id), INDEX (bucket_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin SELECT * FROM objects WHERE fid = murmur($filename) AND bucket_id = $bucket AND filename = $filename
  • 53. CREATE TABLE entries_int ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, fid INT UNSIGNED NOT NULL, bid INT UNSIGNED NOT NULL, filename VARCHAR(255) NOT NULL, INDEX (fid, bid), INDEX (bid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin CREATE TABLE entries_char ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, filename VARCHAR(255) NOT NULL, bid INT UNSIGNED NOT NULL, UNIQUE INDEX (filename, bid), INDEX (bid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin
  • 54. .--------------------------------------------------. | table_name | total_kb | data_kb | index_kb | +--------------+-----------+-----------+-----------+ | entries_char | 3360.0000 | 1552.0000 | 1808.0000 | | entries_int | 2080.0000 | 1552.0000 | 528.0000 | '--------------+-----------+-----------+-----------' (filename 32 )
  • 55. @nodes = sort { murmur_hash(join "/", $a->{node_id},$bucket,$filename) <=> murmur_hash(join "/", $b->{node_id},$bucket,$filename) } @nodes;

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n