Skip to content

Commit bc4d9a0

Browse files
committed
added analytics episode
1 parent c7062ed commit bc4d9a0

7 files changed

+230
-20
lines changed

Gemfile.lock

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,86 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
colorator (0.1)
5-
ffi (1.9.10-x64-mingw32)
6-
jekyll (3.1.1)
7-
colorator (~> 0.1)
4+
activesupport (4.2.7.1)
5+
i18n (~> 0.7)
6+
json (~> 1.7, >= 1.7.7)
7+
minitest (~> 5.1)
8+
thread_safe (~> 0.3, >= 0.3.4)
9+
tzinfo (~> 1.1)
10+
addressable (2.4.0)
11+
colorator (1.1.0)
12+
colored (1.2)
13+
ethon (0.9.0)
14+
ffi (>= 1.3.0)
15+
ffi (1.9.14-x64-mingw32)
16+
ffi (1.9.14-x86-mingw32)
17+
forwardable-extended (2.6.0)
18+
html-proofer (3.0.6)
19+
activesupport (~> 4.2)
20+
addressable (~> 2.3)
21+
colored (~> 1.2)
22+
mercenary (~> 0.3.2)
23+
nokogiri (~> 1.5)
24+
parallel (~> 1.3)
25+
typhoeus (~> 0.7)
26+
yell (~> 2.0)
27+
i18n (0.7.0)
28+
jekyll (3.2.1)
29+
colorator (~> 1.0)
830
jekyll-sass-converter (~> 1.0)
931
jekyll-watch (~> 1.1)
1032
kramdown (~> 1.3)
1133
liquid (~> 3.0)
1234
mercenary (~> 0.3.3)
35+
pathutil (~> 0.9)
1336
rouge (~> 1.7)
1437
safe_yaml (~> 1.0)
1538
jekyll-sass-converter (1.4.0)
1639
sass (~> 3.4)
17-
jekyll-sitemap (0.10.0)
18-
jekyll-watch (1.3.0)
19-
listen (~> 3.0)
20-
kramdown (1.9.0)
40+
jekyll-sitemap (0.11.0)
41+
addressable (~> 2.4.0)
42+
jekyll-watch (1.5.0)
43+
listen (~> 3.0, < 3.1)
44+
json (1.8.3)
45+
kramdown (1.12.0)
2146
liquid (3.0.6)
22-
listen (3.0.5)
23-
rb-fsevent (>= 0.9.3)
24-
rb-inotify (>= 0.9)
25-
mercenary (0.3.5)
47+
listen (3.0.8)
48+
rb-fsevent (~> 0.9, >= 0.9.4)
49+
rb-inotify (~> 0.9, >= 0.9.7)
50+
mercenary (0.3.6)
51+
mini_portile2 (2.1.0)
52+
minitest (5.9.0)
53+
nokogiri (1.6.8-x64-mingw32)
54+
mini_portile2 (~> 2.1.0)
55+
pkg-config (~> 1.1.7)
56+
nokogiri (1.6.8-x86-mingw32)
57+
mini_portile2 (~> 2.1.0)
58+
pkg-config (~> 1.1.7)
59+
parallel (1.9.0)
60+
pathutil (0.14.0)
61+
forwardable-extended (~> 2.6)
62+
pkg-config (1.1.7)
2663
rb-fsevent (0.9.7)
27-
rb-inotify (0.9.5)
64+
rb-inotify (0.9.7)
2865
ffi (>= 0.5.0)
29-
rouge (1.10.1)
66+
rouge (1.11.1)
3067
safe_yaml (1.0.4)
31-
sass (3.4.21)
68+
sass (3.4.22)
69+
thread_safe (0.3.5)
70+
typhoeus (0.8.0)
71+
ethon (>= 0.8.0)
72+
tzinfo (1.2.2)
73+
thread_safe (~> 0.1)
74+
yell (2.0.6)
3275

3376
PLATFORMS
3477
x64-mingw32
78+
x86-mingw32
3579

3680
DEPENDENCIES
81+
html-proofer
3782
jekyll
3883
jekyll-sitemap
3984

4085
BUNDLED WITH
41-
1.11.2
86+
1.13.1

_posts/2015-10-13-Jenkins & GitHub + Powershell Params.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date: 2015-10-13 12:00:00 -0500
55
categories: Jenkins
66
permalink: lessons/jenkins-github-powershell-params
77
excerpt: "In this lesson, we're going to integrate Jenkins and Github for version control. We'll start off with a Jenkins master running on Ubuntu, with a Server"
8-
weight: 14
8+
weight: 15
99
difficulty: medium
1010

1111
---

_posts/2015-10-13-Jenkins for Operations.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date: 2015-10-13 12:00:00 -0500
55
categories: Jenkins
66
permalink: lessons/jenkins-for-operations
77
excerpt: "If you haven't heard of Jenkins, it's something that your developer friends have probably been using for several years, but it can help tremendously"
8-
weight: 13
8+
weight: 14
99
difficulty: easy
1010

1111
---
@@ -17,7 +17,7 @@ If you haven’t heard of Jenkins, it’s something that your developer friends
1717

1818
An even simpler explanation is that if you have a bunch of scripts that your team runs regularly, Jenkins will give you the perfect interface for running those scripts on any and as many servers as you’d like, while also tracking who ran what and when.
1919

20-
Let me go ahead and show you a little bit about what we’re talking about. Once you’ve installed Jenkins, this is exactly what the interface is going to look like.
20+
Let me go ahead and show you a little bit about what we’re talking about. Once you’ve installed Jenkins, this is exactly what the interface is going to look like.
2121
*Note–If you need help installing Jenkins, just visit wiki.jenkins-ci.org or use our Vagrant file to get started immediately.*
2222

2323
Creating a Job
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
---
2+
layout: post
3+
title: "CCJPE: Jenkins Analytics"
4+
date: 2016-9-17 12:00:00 -0500
5+
categories: Jenkins
6+
permalink: lessons/jenkins-analytics
7+
excerpt: "Overview of Jenkins Analytics Plugin"
8+
weight: 13
9+
image: 'jenkinscourse.png'
10+
difficulty: hard
11+
12+
---
13+
{% include youtube.html id="NP8FNlmWgDg" %}
14+
{% include hired2.html %}
15+
16+
1. Table of Contents
17+
{:title="Table of Contents"}
18+
{:toc}
19+
20+
Cloud Config File Downloads
21+
---------------------------
22+
* [CJOC Cloud Config](https://www.devopslibrary.com/scripts/cjoc.yaml)
23+
* [Jenkins Master01](https://www.devopslibrary.com/scripts/master01.yaml)
24+
* [Jenkins Master02](https://www.devopslibrary.com/scripts/master02.yaml)
25+
* [Jenkins Slave01](https://www.devopslibrary.com/scripts/slave01.yaml)
26+
* [ElasticSearch](https://www.devopslibrary.com/scripts/elasticsearch.yaml)
27+
28+
Introduction
29+
------------
30+
Welcome to the DevOps Library! This is Samantha, and in this episode, we're
31+
going to cover Cloudbees Jenkins Analytics or CJA for short. While it may not
32+
be necessary for smaller environments, Jenkins analytics is awesome once you
33+
start trying to scale. It'll help you answer questions such as "Why is my
34+
Jenkins master running slowly?" or "How fast are our jobs running?". It's
35+
also pretty easy to configure.
36+
37+
Before we get started, though, we want to give a quick shout out to
38+
[Hired.com](http://www.hired.com/devopslibrary) for being kind enough to sponsor
39+
our Jenkins course. If you aren’t familiar with [Hired.com](http://www.hired.com/devopslibrary), it’s a great company that
40+
completely reverses the traditional job search, by having companies apply to
41+
you, instead of you always doing the tedious work of applying. Thousands of
42+
companies look to [Hired.com](http://www.hired.com/devopslibrary) to connect
43+
with the best of the best in our field, like you! OH. And if you do end up
44+
signing up through our personal link, and landing a new job, [Hired.com](http://www.hired.com/devopslibrary) will give you a 2k bonus for
45+
being a loyal supporter of the DevOps Library!
46+
47+
Getting Started
48+
---------------
49+
Alright, let's go ahead and get started! First, we're going to need to set up
50+
a Jenkins Operations Center. If you've been following along, you should already
51+
be good to go, but if not, don't worry! Just watch our last episode
52+
[here](https://www.devopslibrary.com/lessons/jenkins-cjoc), or you can sign up
53+
for a trial at [Cloudbees.com](https://www.cloudbees.com/get-started).
54+
55+
Once that's setup, go to "Manage Jenkins," followed by "Configure Analytics."
56+
On this page, we need to tell Jenkins where to store our analytics data. While
57+
you do have the option of using an embedded form of [Elasticsearch](https://www.elastic.co/products/elasticsearch), it doesn't work
58+
that well, even for test instances. Because of that, we're going to set up a
59+
remote elastic search instance. First, spin up a new Ubuntu 14.04 server. Once
60+
it comes up, install Java JDK 8 by running the following commands.
61+
62+
``` bash
63+
add-apt-repository ppa:webupd8team/java -y
64+
echo 'debconf shared/accepted-oracle-license-v1-1 select true' | debconf-set-selections
65+
echo 'debconf shared/accepted-oracle-license-v1-1 seen true' | debconf-set-selections
66+
apt-get update
67+
apt-get install oracle-java8-installer -y
68+
```
69+
70+
Next, let's install ElasticSearch. Run the following commands to
71+
install version 1.7.4.
72+
73+
``` bash
74+
wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.4.deb
75+
dpkg -i elasticsearch-1.7.4.deb
76+
echo 'network.host: 0.0.0.0' > /etc/elasticsearch/elasticsearch.yml
77+
service elasticsearch start
78+
```
79+
80+
While you can use a newer version of Elasticsearch, **1.7.4** is the version
81+
that Cloudbees recommends, and we did run into issues on some of the newer
82+
releases. Lastly, once Elasticsearch finishes installing, we need to allow
83+
remote connections to Elasticsearch. Open up
84+
**/etc/elasticsearch/elasticsearch.yml**.
85+
86+
Add `'network.host: 0.0.0.0'`, then save and close the file. Now run
87+
88+
``` bash
89+
service elasticsearch start
90+
```
91+
92+
Then switch back to our Jenkins Operations server.
93+
94+
Click the "Elasticsearch Configuration** dropdown, and select
95+
"Remote Elasticsearch Instance". For the URL, type "http://IpOfElasticSearch:9200".
96+
Then click "Test Connection". Perfect, there we go! Now scroll down a bit,
97+
and select "Enable" under the "Analytics Reporting Configuration". For
98+
the reporting endpoint, paste in the URL to our Jenkins Operations Center,
99+
followed by slash feeder, then hit save.
100+
101+
Now we need to enable analytics reporting on our individual masters. On each
102+
master, go to "Manage Jenkins", "Configure Analytics", then select
103+
"Enable". The reporting endpoint is the same as what we used earlier, the URL
104+
to our operations center followed by /feeder. Now hit save. Great job!! We've
105+
finally finished setting up Jenkins analytics. Now go ahead and kick off some
106+
jobs to generate some data. Once the jobs finish running, switch to the CJOC
107+
and click the "Build Analytics" tab.
108+
109+
![slowjob](/images/slowjob.png)
110+
111+
At this point, feel free to wander around and see what information might be
112+
useful for your team. Let's go through a few examples to get you started. What
113+
if we'd like to know which jobs are taking the longest to run? Click the "Node
114+
performance" tab. On the right, we can see that "slowjob" is by far our slowest
115+
job, and if we scroll down we can see the average duration of the top 10 longest
116+
running jobs. Or maybe someone is complaining about the performance of one of
117+
our Jenkins masters. If you go to the "Performance Analytics" tab, we can
118+
easily see how much CPU, memory, and executors are in use on each master.
119+
120+
Pretty cool huh? Well, that's it for our lesson on Jenkins Analytics, great
121+
job following along. If you'd like to make more advanced dashboards, you can
122+
use the Analytics Dashboard creator to make pretty much anything you'd like; it
123+
just takes some experience with Kibana. We'd like to give another shout out to
124+
Hired for sponsoring this course. If you're into DevOps, there's a pretty good
125+
chance you've had to deal with pushy recruiters and countless emails, as well as
126+
spent many hours searching for DevOps opportunities.
127+
128+
The reason we love using Hired is that it completely reverses this situation
129+
and puts the power back in your hands, by having companies send you interview
130+
requests that you can choose to pursue. (They even come with upfront salary and
131+
equity!)
132+
133+
By having you fill out information that is specific to what you’re looking for
134+
and your individual strengths and talents, it ensures that the only companies
135+
you'll hear from will be a great fit for you. Plus, Hired is entirely free,
136+
and they’ll even give you a $2,000 bonus after you land a job, using our DevOps
137+
library link!
138+
139+
We highly recommend giving them a shot, they do a fantastic job, especially for
140+
the DevOps community.
141+
142+
Thanks again for watching today! If you like our videos, please subscribe to
143+
our Youtube channel! If you love them and want to help support us, visit
144+
patreon.com/devopslibrary, we’ll even list you on our high scores at the
145+
end of each video. Thanks again, see you again soon!
146+
147+
Thanks for Watching!
148+
--------------------
149+
[Subscribe to our YouTube channel](https://www.youtube.com/channel/UCOnioSzUZS-ZqsRnf38V2nA?sub_confirmation=1) or follow [DevOpsLibrary on Twitter](https://twitter.com/intent/user?screen_name=devopslibrary).
150+
151+
{% include subscribe.html %}

images/slowjob.png

381 KB
Loading

scripts/cjoc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ runcmd:
99
- wget -q -O - http://nectar-downloads.cloudbees.com/jenkins-operations-center/1.625/debian/cloudbees.com.key | sudo apt-key add -
1010
- echo deb http://nectar-downloads.cloudbees.com/jenkins-operations-center/1.625/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins-oc.list
1111
- apt-get update
12-
- apt-get install oracle-java7-installer -y
12+
- apt-get install oracle-java8-installer -y
1313
- apt-get install jenkins-oc -y

scripts/elasticsearch.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#cloud-config
2+
hostname: elasticsearch
3+
fqdn: elasticsearch
4+
manage_etc_hosts: true
5+
runcmd:
6+
- add-apt-repository ppa:webupd8team/java -y
7+
- echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
8+
- echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
9+
- apt-get update
10+
- apt-get install oracle-java8-installer -y
11+
- wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.4.deb
12+
- dpkg -i elasticsearch-1.7.4.deb
13+
- "echo 'network.host: 0.0.0.0' > /etc/elasticsearch/elasticsearch.yml"
14+
- service elasticsearch start

0 commit comments

Comments
 (0)