Skip to content

Commit

Permalink
Move sleep line
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDaoust committed Feb 14, 2020
1 parent 4f6e855 commit 4a0834c
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions docs/tutorials/prometheus.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text"
"colab_type": "text",
"id": "9wRVaOQZWgRc"
},
"source": [
"Caution: In addition to python packages this notebook uses `sudo apt-get install` to install third party packages."
Expand Down Expand Up @@ -162,6 +163,7 @@
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "m6KXZuTBWgRm",
"colab": {}
},
"source": [
Expand Down Expand Up @@ -216,24 +218,22 @@
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "n9ujlunrWgRx",
"colab": {}
},
"source": [
"# Run `./coredns` as a background process.\n",
"# IPython doesn't recognize `&` in inline bash cells.\n",
"get_ipython().system_raw('./coredns &')\n",
"\n",
"# Give the server a few seconds to startup.\n",
"import time\n",
"time.sleep(10)"
"get_ipython().system_raw('./coredns &')"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text"
"colab_type": "text",
"id": "5ZWe5DwcWgR1"
},
"source": [
"The next step is to setup Prometheus server and use Prometheus to scrape CoreDNS metrics that are exposed on port `9153` from above. The `prometheus.yml` file for configuration is also available for [download](https://github.com/tensorflow/io/blob/master/docs/tutorials/prometheus/prometheus.yml):\n"
Expand All @@ -243,6 +243,7 @@
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "2HFfTfHkWgR3",
"colab": {}
},
"source": [
Expand All @@ -260,20 +261,26 @@
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "VSJGsQtoWgR7",
"colab": {}
},
"source": [
"# Run `./prometheus` as a background process.\n",
"# IPython doesn't recognize `&` in inline bash cells.\n",
"get_ipython().system_raw('./prometheus &')"
"get_ipython().system_raw('./prometheus &')\n",
"\n",
"# Give the server a few seconds to startup.\n",
"import time\n",
"time.sleep(10)"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text"
"colab_type": "text",
"id": "rLxPgbI1WgR_"
},
"source": [
"In order to show some activity, `dig` command could be used to generate a few DNS queries against the CoreDNS server that has been setup:"
Expand All @@ -296,6 +303,7 @@
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "mrYsnIrVWgSE",
"colab": {}
},
"source": [
Expand All @@ -308,6 +316,7 @@
"cell_type": "code",
"metadata": {
"colab_type": "code",
"id": "5APx3wD6WgSH",
"colab": {}
},
"source": [
Expand Down Expand Up @@ -527,4 +536,4 @@
]
}
]
}
}

0 comments on commit 4a0834c

Please sign in to comment.