Skip to content

Commit

Permalink
Only display active dashboards
Browse files Browse the repository at this point in the history
Summary:
This commit incorporates the backend's `is_active` plugin functions and
the related `plugins_listing` handler, and uses them on the client: we
will only display dashboards that correspond to backend plugins that are
active.

Test Plan:
  - Launch TensorBoard with a normal data set and note that the correct
    set of dashboards is displayed.
  - Launch TensorBoard with a nonexistent or empty logdir and observe
    the global "no data" message.
  - Launch TensorBoard and cause the `plugins_listing` network request
    to fail. (In Chrome: Network devtools tab, right-click the request,
    select "Block Request URL", refresh.) Note the resulting message.
    Then, unblock the request, and click TensorBoard's reload button:
    everything should work as usual.
  - Launch TensorBoard with a large data set, and open the frontend
    before it's read any text summaries. Then, click TensorBoard's
    reload button and note that the "Text" dashboard tab appears and
    functions.
  - Launch TensorBoard on a large data set. Select the "text" dashboard.
    Then, relaunch the TensorBoard backend on the same port, and click
    the frontend's reload button before any text summaries are loaded.
    Note that TensorBoard removes the text dashboard and shoves the user
    over to a different dashboard (the first dashboard loaded) with a
    notice.
  - Launch TensorBoard, let it load data, then kill the server and click
    TensorBoard's reload button. Note that the already-loaded features
    of TensorBoard are still operational.

Also, `bazel run //tensorboard/functionaltests:core_test` and step away
from your computer for a minute or so.

wchargin-branch: active-dashboards
  • Loading branch information
wchargin committed Jul 7, 2017
1 parent 76585f8 commit 66fd107
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 60 deletions.
2 changes: 2 additions & 0 deletions tensorboard/components/tf_backend/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type RunTagUrlFn = (tag: string, run: string) => string;
export interface Router {
logdir: () => string;
runs: () => string;
pluginsListing: () => string;
isDemoMode: () => boolean;
pluginRoute: (pluginName: string, route: string) => string;
pluginRunTagRoute: (pluginName: string, route: string) => RunTagUrlFn;
Expand Down Expand Up @@ -60,6 +61,7 @@ export function createRouter(dataDir = 'data', demoMode = false): Router {
return {
logdir: () => dataDir + '/logdir',
runs: () => dataDir + '/runs' + (demoMode ? '.json' : ''),
pluginsListing: () => dataDir + '/plugins_listing',
isDemoMode: () => demoMode,
pluginRoute,
pluginRunTagRoute,
Expand Down
4 changes: 2 additions & 2 deletions tensorboard/components/tf_storage/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ function _componentToDict(component: string): StringDict {
const tokens = component.split('&');
tokens.forEach((token) => {
const kv = token.split('=');
// Special backwards compatibility for URI components like #events
if (kv.length === 1 && _.contains(TABS, kv[0])) {
// Special backwards compatibility for URI components like #scalars.
if (kv.length === 1) {
items[TAB] = kv[0];
} else if (kv.length === 2) {
items[decodeURIComponent(kv[0])] = decodeURIComponent(kv[1]);
Expand Down
Loading

0 comments on commit 66fd107

Please sign in to comment.