Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard - Running Index Jobs #153

Closed
quasarea opened this issue Sep 19, 2017 · 8 comments
Closed

Dashboard - Running Index Jobs #153

quasarea opened this issue Sep 19, 2017 · 8 comments

Comments

@quasarea
Copy link

quasarea commented Sep 19, 2017

Would be great to have this bit redesigned, now it covers all System Actions in my case.

You could:

  • merge Words in Spelling Corrector into Memory Usage i.e and extend Running Index Jobs to take two rows. It would still require making it scrollbar as it far bigger than two rows when you have 20 indexers running.
  • move it under the left hand menu (you could place Data Values in its current place)
  • additionally seconds could be abbreviated to just s to save some space
@boyter
Copy link
Owner

boyter commented Sep 19, 2017

Yep something that is likely to get fixed in the next few versions. I want to revisit a lot of how the admin screen works.

boyter added a commit that referenced this issue Sep 20, 2017
@boyter
Copy link
Owner

boyter commented Sep 20, 2017

Pretty simple. So implemented. Sitting in master.

@quasarea
Copy link
Author

quasarea commented Sep 22, 2017

I think it looks better that way (scrolling inside panel-body, not panel and only if exceeds 160px):

\source\src\main\resources\spark\template\freemarker\admin.ftl:25

        .panel-body {
            height:160px !important;
            overflow: auto;
        }

and replaced " " with "<BR>" in \source\src\main\java\com\searchcode\app\service\route\AdminRouteService.java:484

stringBuffer.append(key).append(" <small>(").append(runningTime).append("s)</small>").append(" ");

would be nice to skip the
if its last element in the iteration, but its beyond my current skills in java & notepad ;p

boyter added a commit that referenced this issue Sep 24, 2017
@boyter
Copy link
Owner

boyter commented Sep 24, 2017

Agree with the first (in master already), not so sure about the second. I don't want to put too much information or time into this running box because its only purpose it to let you know if processes are running and if they are taking a long time.

I will keep playing a bit though. Improving the admin screens is something I revisit every now and then.

@quasarea
Copy link
Author

quasarea commented Sep 25, 2017

to defend the second:

  • you already are throwing html there <small>
  • all other panels have content arranged as lists, just this one is space separated

If I would do it in c# it would be like:

var result = string.Join("<BR>", Singleton.getRunningIndexRepoJobs()
                .Where(job => job !=null)
                .Select(job => $"{job.Name}  <small>({Singleton.GetHelpers.GetCurrentTimeSeconds() - job.StartTime}s)</small>"));

            return result;

or if you have to use string builder:

            var stringBuffer = new StringBuilder();
            var jobs = Singleton.getRunningIndexRepoJobs();
            foreach (var job in jobs)
            {
                if (job == null) continue;

                var runningTime = Singleton.GetHelpers.GetCurrentTimeSeconds() - job.StartTime;

                var isLast = job == jobs.Last();

                stringBuffer.Append(job.Name).Append(" <small>(").Append(runningTime).Append("s)</small>").Append(isLast ? "" : "<BR>");
            }

            return stringBuffer.ToString();

I don't know why in that place you:

  • add a space if job is null,
  • add &nbsp; at the end

@boyter
Copy link
Owner

boyter commented Sep 25, 2017

The   is there because intercooler.js will not update if there is an empty or whitespace string, which is annoying. I cannot remember the reason for the space though. Probably formatting issues would be my guess.

BTW its possible to achieve the same code almost using Java 8 streams. Its not quite as nice looking at C# but does the job.

String collect = Singleton.getRunningIndexRepoJobs().keySet().stream()
                        .filter(x -> Singleton.getRunningIndexRepoJobs().get(x) != null)
                        .map(x -> x + " <small>(" + (Singleton.getHelpers().getCurrentTimeSeconds() - Singleton.getRunningIndexRepoJobs().get(x).startTime) + "s)</small>")
                        .collect(Collectors.joining("<br>"));

The result of the above is that it looks like the attached.

screen shot 2017-09-26 at 8 35 52 am

Still not convinced that this is a better outcome though. I had hoped that users would use the superior repository overview page to get this information.

@quasarea
Copy link
Author

Thats because you have repo names short, in my case those are avg of 42 characters and the longest is 65. I'm using namespaces as repo names.

@boyter
Copy link
Owner

boyter commented Sep 26, 2017

Fair point. The only catch is that is useful for yourself but not for those with short file names.

Anyway irrelevant. I merged it in anyway so its sitting in master.

@boyter boyter closed this as completed Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants