►
Description
Francesco Lentini from Artillery shows how you can use Artillery to run load tests and smoke tests to help your services maintain their SLOs.
Artillery: https://artillery.io/
Integration: https://github.com/keptn-sandbox/artillery-service
Announcement: https://artillery.io/blog/shipping-friday-170621/#Keptn-Artillery
Learn more: https://keptn.sh
Get started with tutorials: https://tutorials.keptn.sh
Join us in Slack: https://slack.keptn.sh
Star us on Github: https://github.com/keptn/keptn
Follow us on Twitter: https://twitter.com/keptnProject
A
Hi
everyone
today,
I'm
really
excited
to
see
how
you
can
automate
performance
and
load
testing
with
artillery
and
captain.
My
name
is
jurgen.
I'm
a
maintainer
of
the
captain
project
and
today
with
me,
is
francesco
lentini
from
the
artillery
team.
Hi
francesco,
hi
everyone,
and
I'm
really
excited
to
see
what
artilleries,
how
you
can
write
load
tests
in
artillery,
how
you
can
configure
it
and
then,
of
course,
how
you
can
run
it
with
captain.
I
know
you
have
prepared
a
couple
of
slides
and
a
very
exciting
demo.
A
B
Yeah,
thank
you,
hello.
Everyone.
My
name
is
francesco,
and
today
I'm
going
to
talk
to
you
about
how
artillery
works,
what
it
is
and
how
it
works
with
with
captain
a
little
bit
about
me.
First
up
till
recently,
I
was
an
independent
contractor
working
as
a
node.js
developer.
I
was
helping
companies
transition
to
microservice
architectures
and
I've
been
using
artillery
on
several
different
projects
over
the
last
few
years,
and
I
am
now
part
of
the
artillery
team.
B
A
B
It
supports
the
most
popular
protocols
like
http
and
web
sockets,
and
others
are
supported
by
our
plugins,
and
it
already
allows
you
to
send
metrics
to
external
monitoring
systems
such
as
statsd
influx
db,
datadog,
etc,
etc.
B
B
This
makes
it
easily
extensible
it's
easy
to
write
a
custom
plugin
to
to
fit
your
needs
in
case
a
plug-in
for
your
target
platform
or
protocol
doesn't
exist
already.
B
They
are
made
of
two
main
sections:
one
is
the
configuration
the
test
configuration
and
one
contains
one
or
more
scenarios,
so
we
can
see
here
our
target
service,
what
we're
going
to
hit
with
our
with
our
test
and
the
load
phase.
B
Each
virtual
user
that
is
created
will
will
go
through
this.
This
flow
and
it
will
first
get
get
a
card,
and
then
it
will
get
the
items
in
this
card
and
it
will
post
an
item
to
to
to
our
our
cart.
B
B
B
So
yeah,
let's,
let's
oh
yeah-
it's
also
possible
to
have
to
get
this
data
test.
Data
from
external
data
sources
and
out
of
the
box
artillery
already
supports
reading
data
from
csv.
So
it's
easy
to
do
something
like
this.
B
This
and
as
I
said,
this
will
run
for
two
minutes,
120
seconds
and
artillery
will
will
gives
us
will
give
us
an
update
of
how
the
test
is
doing
by
the
way,
since
artillery
is
a
command
line
tool,
it's
easy
to
integrate
with
your
ci
cd
pipeline.
B
B
And
artillery
will
return
with
non-zero
if
this
condition
is
not
met.
If
the
p95
is
more
than
100,
milliseconds
artillery
will
return
with
the
node
zero.
B
A
B
A
So
this
is,
this
is
pretty
exciting,
I
think
even
having
the
yeah
the
possibility
to
define
the
exact
payload
for
post
requests
here
and
also
the
the
integration
with
the
csv
that
you
showed
us.
I
think
it's
really
powerful
to
kind
of
scale.
A
B
Yeah,
I
think
the
fact
that
tests
are
written
in
yaml
make
it
easy
for
make
it
easier
for
also
non
strictly
deaf
people
to
to
read
them
and
modify
them
so
yeah
and
yeah.
So
our
test
is
complete
and
we
get.
We
get
a
report
here
of
how
this
this
was
doing.
B
B
In
the
report
viewer,
so
you
can,
you
can
load
the
report.
This
is
a
for
a
print
from
a
previous
run.
A
B
And
some
information
about
your
test
run
with
a
lot
of
colors.
So
how
does
all
this
fit
into
the
captain
ecosystem?
So
we
we
just
released
an
integration
for
captain
the
the
artillery
service.
You
can
find
it
as
part
of
the
captain
sandbox,
and
it's
quite
easy
to
install
you
just
need
to
apply
the
service
definition
here
and
artillery
will
will
come
with
it.
You
don't
need
to
install
anything,
but
but
we
apply
yours
the
service
to
the
cluster.
B
A
So
I
think
what
I
just
want
to
highlight
here,
while
we're
waiting
for
the
for
the
delivery.
What's
really
cool
is
that
when
francesco
is
showing
the
demo
the
left
hand,
side
of
the
demo
with
the
artillery
load
test
will
stay
the
same.
So
we
are
using
this
that
we've
already
seen
doing
this
from
the
local
machine.
We're
now
using
this
file.
A
It's
already
added
to
captain
and
we're
just
triggering
now
captain
everything
will
now
run
inside
captain
and
triggered
by
captain,
but
it's
it's
basically
the
same
definition,
so
you
don't
have
to
change
yes
by
your
definitions.
You
just
add
this
to
the
git
repository
and
we
will
see
also
the
benefit
of
the
whole
thing.
Just
in
a
minute.
B
Yes,
exactly
yeah,
that's
a
good
point.
The
tests
that
are
running
that
I
just
run
are
the
same.
That
captain
is
gonna
run
for
us,
so
the
artillery
service
will
react
to
the
test,
triggered
the
cloud
events
triggered
by
captain
and
now
it's
it's,
it's
deploying
our
our
service.
Let's
see
what
is
going
to
load,
so
we
are
on
the
dev
branch
at
the
moment.
B
And
we
have
an
artillery
configuration
that's
available
for
all
the
stages,
so,
depending
on
the
test
strategy,
it
will
trigger
a
specific
resource
so
for
a
function
for
for
this
test
strategy,
which
is
the
functional
one.
B
This
is
the
test
we
are
triggering,
so
artillery
can
also
be
used
to
do
smoke
smoke
testing
via
the
plug-in,
the
expectation
plug-in-
and
this
is
slightly
different
from
what
I
showed
you
earlier.
B
It
will
just
create
one
single
user
that
will
run
through
all
these
steps,
making
sure
that
our
response
codes
match
what
we
what
we
expect.
Okay,
so
for
this
endpoint,
it
expresses
200.
We
add
an
item
to
our
cart
and
we
expect
this
and
we
can
also
do
some
more
more
complex
comparisons.
So
we
can
capture
the
a
variable
from
the
response
payload
and
we
can
make
sure
that
that
it
matches
our
expectation.
B
Okay,
if
it
doesn't
this
bit
here,
will
fail
and
and
our
our
delivery
will
be
stopped.
It
didn't
fail
in
this
case,
so
our
delivery
is
being
promoted
to
to
the
staging
part.
Okay.
B
B
A
And
I
think,
what's
also
worth
to
mention
here,
is
that
you
won't
find
here
the
concrete
url
that
captain
is
that
is
basically
or
not
not
captain,
but
where
the
where
artillery
is
sending
the
load
to,
but
this
is
injected-
and
this
is
part
of
the
of
the
artillery
integration
with
captain
so
that
whenever
you
do
a
new
deployment
and
maybe
the
url
might
change-
or
maybe
you
want
to
reuse
this
test
file
in
from
staging
also,
maybe
you
want
to
use
it
in
production,
you
can
you
can
use
or
reuse
the
same
test
files
because
the
url
will
be
injected
then
in
basically,
when
the
deployment
is
finished,
captain
figured
out
the
the
url.
A
Then
this
deployment
url
will
be
used,
so
you
can
easily
reuse
these
files.
I
think
that's
also
really
really
powerful
yeah.
B
That
is
correct.
Captain
will
override
the
configuration
here
and
it
will
inject
the
service
url
at
runtime.
So
we
don't
need
to
to
define
it
as
part
of
our
scenario,
so
our
tests
are
still
running.
There
is
no
way
currently
for
us
to
to
read
the
artillery
output,
but
it's
in
the
pipeline,
so
we
cannot
have
an
update
here
of
how
our
tests
are
doing,
but
we
can
yeah.
B
We
can
of
course
get
it
from
from
our
pod,
so
yeah,
that's
just
completed
our
test
run
and.
A
Actually,
this
can
already
be
done,
so
there
is
a
a
change
or
or
an
update
on
the
status.
This
can
be
sent
to
captain
and,
as
francesco
said,
it's
it's
already
in
the
pipeline.
So
this
also
the
all
the
the
status
changes
and
all
the
different
updates
can
be
already
sent
to
captain,
and
this
can
be
shown
here.
B
Yeah,
so
the
tests
have
finished
and
for
this
for
staging,
we
have
an
slo
file
here.
So
we
can
see
that
that
our
configuration
is
defined
here.
B
So
we
have
an
slo
that
that
is
going
to
be
used
to
our
by
our
evaluation
step.
Here,
evolution
has
passed
and
we
can
have
a
look
at
a
more
detailed
view
on
how
captain
does
the
how
the
quality
gates
work
in
in
captain.
B
So
this
is
pasta,
it
gets
compared
to
our
previous
run
and
yeah.
We
can
see
that
that
the
data
is
is
within
our
thresholds,
so
our
deployment
can
be
promoted
to
the
next
stage,
which
is
production.
A
And
I
think
what's
what's
really
powerful
here
now,
is
that,
on
the
one
hand,
side
we've
seen
how
you
can
do,
or
already,
let's
say,
a
check
directly
in
artillery
if
the
the
tests
are
successful
or
not
by
adding
by
using
the
expectation,
plugin
and
doing
directly
the
checks
kind
of
a
smoke
test
directly
in
artillery.
But
maybe
you
have,
you
want
to
have
a
larger
slo
evaluation,
not
only
on
the
response
time
but
failure
rate,
maybe
even
some
kind
of
infrastructure.
A
Metrics
like
the
cpu
usage
or
ram
memory
usage,
then
it
really
makes
sense
to
use
the
captain.
Quality
gates,
put
all
the
slos
into
the
quality
gate
and
then,
after
the
testing
phase
have
captain
do
the
evaluation
of
of
the
tests
and
basically
of
the
of
the
whole
test
run.
A
What
whatever
the
time
was.
So
if
you
make
it
longer,
then
captain
would
also,
of
course,
respect
the
longer
test
run
and
do
the
evaluation
for
the
longer
test
run.
B
Yeah,
definitely
you
can
set
up
so
artillery
is
focused
on
latency
latency
metrics,
while
with
captain
you
have
a.
A
And
I
think
in
this
example,
the
data
is
coming
from
promethouse.
So,
although
artillery
does
not
have
the
prometheus
integration
today-
and
I
know
it's
on
the
it's
also
on
the
on
the
roadmap,
but
we
can
still
use
promethor
since
we
are
doing
the
prometheus
is
scraping
the
data
directly
from
the
clock,
shop
application,
and
so
we
are
kind
of
taking
the
round
trip.
Yes,
we
are
firing.
The
load
from
artillery
to
the
sock
shop.
A
Prometheus
is
monitoring
the
sock
shop
and
captain
is
querying
data
from
prometheus
and
doing
the
whole
quality
gate
evaluation
on
prometheus
and
as
we
as
we
see,
we
did
a
couple
of
test,
runs
or
actually
francesco
did
a
couple
of
test
runs.
So
we
can
also
see
the
previous
evaluations
where
we
have
different
kind
of
data-
it's
not
always
100
percent.
It
also
depends
on
the
ability
of
the
pod
like
the
how
the
how
fast
the
infrastructure
is.
It
is
running
and
we
can
see
all
the
different
kinds
of
evaluations
here.
A
Yes,
it's
always
good
that
we
have
no
errors
in
the
software
application,
but
it's
not
always
really
fast
in
responding.
That's
that's
what
we
see.
B
Yeah,
so
exactly
so,
we
we
just.
We
promoted
this
to
the
production
now
and
we
just
have
a
light
smoke
test
in
production
to
make
sure
that
all
endpoints
were
are
working
as
expected
in
the
same
way
as
as
dev
that
works
yeah
and
yes,.
A
I
think
that
that's
pretty
cool
can
you
show
us
again
the
artillery
github
repository,
because
I
just
want
to
highlight
how
to
get
started
and
it's
really
easy,
the
the
team
and
especially
francesco
from
artillery
they
have
done
a
phenomenal
job
in
providing
this
integration
and
to
use
this
integration.
A
It
will
listen
to
all
the
events
for
a
test
triggered
events
as
you,
if
you're
already
familiar
with
captain
everything
is
event
based
and
whenever
there
is
a
test
triggered,
then
artillery
will
the
artillery
integration
will
start
its
work
and
we'll
actually
look
for
and
for
the
the
artillery
files
in
the
captain,
git
repository
for
the
demo
francesco
has
already
added
those
files,
as
we've
also
seen
in
the
in
the
github
repository.
A
So
I
think
it's
really
easy
to
get
started
and
and
also
how
to
write
artillery
tests.
It's
it's.
It's
really
easy
to
use.
Maybe
one
question
from
from
mind:
are
there
any
best
practices
on
how
to
write
artillery
tests
and
load
tests.
B
Well,
this
is,
from
my
personal
personal
point
of
view,
not
particular
best
practices
on
how
to
write
tests
in
artillery
just
start
as
soon
as
you
can
make
it
part
of
your
development
process.
Since
it's
quite
easy
to
run
this
from
your
laptop,
it's,
it
should
be
part
of
your
development
cycle
and
then,
as
we
said,
once
you've
got
these
tests
running
locally.
It's
going
to
be
super
easy
to
to
add
them
to
your
captain
sequence.
A
Cool
yeah,
I
I
think
so
as
well.
It's
really
get
started
with
artillery
pretty
early.
You
already
get
all
the
http
response
code
as
we've
seen.
So,
if
you
already
get
the
like
the
400s
well,
while
you're
still
developing,
you
can
already
fix
this.
It
is
very,
very
powerful
and
then
later
on,
just
add
those
files
to
captain,
and
you
can
even
build
some
kind
of
self-service
scenarios
with
captain
plus
artillery,
which
is
the
trigger
a
new
delivery
with
captain
it
will
deploy
the
new
version.
A
It
will
test
the
new
version
and
it
will
give
you
back
the
evaluation
of
the
quality
gate.
So
you
can
either
do
just
the
single
stage,
deployment
and
delivery
with
captain
we've
seen
a
more
complex
one
that
francesco
built
with
the
multi-stage
delivery.
But
if
you
want
to
do
it
more
in
the
self-service
kind
of
way,
just
do
one
stage
deploy
it
test,
it
have
a
quality
gate
evaluation
and
then
you
can
reiterate
and
often
on
the
quality
of
the
service.
A
Yeah,
I
think,
we've
seen
a
lot
in
this
like
20
25
minutes.
Thank
you
so
much
for
for
presenting
this.
Is
there
anything
else
we
should
know
about
artillery
and
captain.
B
A
B
Give
it
a
go
and
if
you
we
are
of
course
open
to
contributing
contributor
and
yeah,
we
have
a
roadmap.
So
if
you
want
to
participate
in
that,
please
please
get
in
touch.
A
Cool,
thank
you
then
yeah.
I
just
want
to
also
emphasize
this.
Please
give
it
a
try.
I
think
it's
all,
although
it's
it's
it's
pretty
new,
I
think
it's
already
pretty
powerful
can
already
be
used.
Please
let
us
know
how
it
goes.
You
will
also
find
us
in
the
captain
slack
on
the
slack.captain.h.
A
We
are
happy
to
to
engage
with
you
there
and
hear
your
stories
how
you,
how
you're
using
artillery
in
captain,
then
francesco
thanks
so
much
for
presenting
this.
Hopefully
we
hear
some
success
stories
pretty
soon,
and
then
we
can
do
another
video
on
this.
For
today.
I
really
want
to
thank
you
and
give
it
a
try,
dear
captain
community,
and
do
all
your
load
tests
now
with
artillery.