Пример #1
0
            protected override void Render(HtmlBlock.Block html)
            {
                AList <CapacitySchedulerQueueInfo> subQueues = (csqinfo.qinfo == null) ? csqinfo.csinfo
                                                               .GetQueues().GetQueueInfoList() : csqinfo.qinfo.GetQueues().GetQueueInfoList();

                Hamlet.UL <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> ul = html.Ul("#pq");
                foreach (CapacitySchedulerQueueInfo info in subQueues)
                {
                    float used       = info.GetUsedCapacity() / 100;
                    float absCap     = info.GetAbsoluteCapacity() / 100;
                    float absMaxCap  = info.GetAbsoluteMaxCapacity() / 100;
                    float absUsedCap = info.GetAbsoluteUsedCapacity() / 100;
                    Hamlet.LI <Hamlet.UL <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > li = ul.Li().A(
                        Q).$style(Width(absMaxCap * QMaxWidth)).$title(StringHelper.Join("Absolute Capacity:"
                                                                                         , Percent(absCap))).Span().$style(StringHelper.Join(QGiven, ";font-size:1px;", Width
                                                                                                                                                 (absCap / absMaxCap))).('.').().Span().$style(StringHelper.Join(Width(absUsedCap
                                                                                                                                                                                                                       / absMaxCap), ";font-size:1px;left:0%;", absUsedCap > absCap ? QOver : QUnder))
                                                                                              .('.').().Span(".q", Sharpen.Runtime.Substring(info.GetQueuePath(), 5)).().Span(
                        ).$class("qstats").$style(Left(QStatsPos)).(StringHelper.Join(Percent(used), " used"
                                                                                      )).();
                    csqinfo.qinfo = info;
                    if (info.GetQueues() == null)
                    {
                        li.Ul("#lq").Li().(typeof(CapacitySchedulerPage.LeafQueueInfoBlock)).().();
                        li.Ul("#lq").Li().(typeof(CapacitySchedulerPage.QueueUsersInfoBlock)).().();
                    }
                    else
                    {
                        li.(typeof(CapacitySchedulerPage.QueueBlock));
                    }
                    li.();
                }
                ul.();
            }
Пример #2
0
            protected override void Render(HtmlBlock.Block html)
            {
                ICollection <FairSchedulerQueueInfo> subQueues = fsqinfo.qinfo.GetChildQueues();

                Hamlet.UL <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> ul = html.Ul("#pq");
                foreach (FairSchedulerQueueInfo info in subQueues)
                {
                    float capacity               = info.GetMaxResourcesFraction();
                    float steadyFairShare        = info.GetSteadyFairShareMemoryFraction();
                    float instantaneousFairShare = info.GetFairShareMemoryFraction();
                    float used = info.GetUsedMemoryFraction();
                    Hamlet.LI <Hamlet.UL <Org.Apache.Hadoop.Yarn.Webapp.Hamlet.Hamlet> > li = ul.Li().A(
                        Q).$style(Width(capacity * QMaxWidth)).$title(StringHelper.Join(StringHelper.Join
                                                                                            (SteadyFairShare + ":", Percent(steadyFairShare)), StringHelper.Join(" " + InstantaneousFairShare
                                                                                                                                                                 + ":", Percent(instantaneousFairShare)))).Span().$style(StringHelper.Join(QGiven
                                                                                                                                                                                                                                           , ";font-size:1px;", Width(steadyFairShare / capacity))).('.').().Span().$style(
                        StringHelper.Join(QInstantaneousFs, ";font-size:1px;", Width(instantaneousFairShare
                                                                                     / capacity))).('.').().Span().$style(StringHelper.Join(Width(used / capacity),
                                                                                                                                            ";font-size:1px;left:0%;", used > instantaneousFairShare ? QOver : QUnder)).('.'
                                                                                                                                                                                                                         ).().Span(".q", info.GetQueueName()).().Span().$class("qstats").$style(Left(QStatsPos
                                                                                                                                                                                                                                                                                                     )).(StringHelper.Join(Percent(used), " used")).();
                    fsqinfo.qinfo = info;
                    if (info is FairSchedulerLeafQueueInfo)
                    {
                        li.Ul("#lq").Li().(typeof(FairSchedulerPage.LeafQueueBlock)).().();
                    }
                    else
                    {
                        li.(typeof(FairSchedulerPage.QueueBlock));
                    }
                    li.();
                }
                ul.();
            }